diff --git a/app/lib/kubernetes_client.py b/app/lib/kubernetes_client.py index 5b9d449..94ea340 100644 --- a/app/lib/kubernetes_client.py +++ b/app/lib/kubernetes_client.py @@ -18,7 +18,7 @@ def list_validator_stateful_sets(role='authority'): return list(map(lambda sts: sts['metadata']['name'], validator_stateful_sets)) -def list_parachain_collator_stateful_sets(para_id): +def list_parachain_collator_stateful_sets(para_id: str): stateful_sets = kubernetes_client.CustomObjectsApi().list_namespaced_custom_object(group="apps", version="v1", plural="statefulsets", namespace=namespace) collator_stateful_sets = list( @@ -50,7 +50,7 @@ def list_validator_pods(stateful_set_name): return validator_pods -def list_collator_pods(para_id=None, stateful_set_name=None): +def list_collator_pods(para_id: str = None, stateful_set_name: str = None): collator_pods = list_substrate_node_pods('collator') if stateful_set_name: collator_pods = list(filter(lambda pod: pod.metadata.owner_references[0].name == stateful_set_name, collator_pods)) diff --git a/app/lib/network_utils.py b/app/lib/network_utils.py index 3d09ba8..9e77b3e 100644 --- a/app/lib/network_utils.py +++ b/app/lib/network_utils.py @@ -483,7 +483,7 @@ def list_parachains(): return parachains -async def onboard_parachain_by_id(para_id, force_queue_action): +async def onboard_parachain_by_id(para_id: str, force_queue_action: bool): log.info(f'starting to onboard parachain #{para_id}') relay_chain_client = get_relay_chain_client() sudo_seed = network_sudo_seed() @@ -509,7 +509,7 @@ async def onboard_parachain_by_id(para_id, force_queue_action): log.error(f"Couldn't find parachain pod for para_id={para_id}") -async def offboard_parachain_by_id(para_id, force_queue_action): +async def offboard_parachain_by_id(para_id: str, force_queue_action: bool): log.info(f'starting to offboard parachain #{para_id}') substrate_client = get_relay_chain_client() sudo_seed = network_sudo_seed() @@ -521,7 +521,7 @@ async def offboard_parachain_by_id(para_id, force_queue_action): # Collators -def list_parachain_collators(para_id, stateful_set_name=''): +def list_parachain_collators(para_id: str, stateful_set_name: str = ''): collator_pods = list_collator_pods(para_id, stateful_set_name) # Read the first collator pod chain metadata for this para_id to retrieve the chain name if collator_pods: @@ -630,7 +630,7 @@ async def deregister_collator_nodes(chain, nodes, ss58_format): return accounts_to_deregister -async def register_statefulset_collators(para_id, stateful_set_name): +async def register_statefulset_collators(para_id: str, stateful_set_name: str): log.info('starting to register collators in statefulset {}'.format(stateful_set_name)) collators_pods = list_collator_pods(para_id, stateful_set_name) chain = collators_pods[0].metadata.labels['chain'] @@ -639,7 +639,7 @@ async def register_statefulset_collators(para_id, stateful_set_name): await register_collator_nodes(chain, collator_node_names, ss58_format) -async def deregister_statefulset_collators(para_id, stateful_set_name): +async def deregister_statefulset_collators(para_id: str, stateful_set_name: str): log.info('starting to deregister collators in statefulset {}'.format(stateful_set_name)) collators_pods = list_collator_pods(para_id, stateful_set_name) chain = collators_pods[0].metadata.labels['chain']