Skip to content
Snippets Groups Projects

migrate_iptrunk: optical checks

Merged Aleksandr Kurbatov requested to merge feature/nat-473-iptrunk-checks into develop
All threads resolved!
@@ -222,19 +222,44 @@ def calculate_old_side_data(subscription: Iptrunk, replace_index: int) -> State:
@@ -222,19 +222,44 @@ def calculate_old_side_data(subscription: Iptrunk, replace_index: int) -> State:
return {"old_side_data": old_side_data}
return {"old_side_data": old_side_data}
@step("Check Optical levels on the trunk endpoint")
@step("Check Optical PRE levels on the trunk endpoint")
def check_ip_trunk_optical_levels(
def check_ip_trunk_optical_levels_pre(subscription: Iptrunk, callback_route: str) -> State:
 
"""Check Optical PRE levels on the trunk."""
 
extra_vars = {"wfo_ip_trunk_json": json.loads(json_dumps(subscription)), "check": "optical_pre"}
 
 
execute_playbook(
 
playbook_name="iptrunks_checks.yaml",
 
callback_route=callback_route,
 
inventory=f"{subscription.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn}\n"
 
f"{subscription.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_fqdn}\n",
 
extra_vars=extra_vars,
 
)
 
 
return {"subscription": subscription}
 
 
 
@step("Check Optical POST levels on the trunk endpoint")
 
def check_ip_trunk_optical_levels_post(
subscription: Iptrunk,
subscription: Iptrunk,
callback_route: str,
callback_route: str,
 
new_node: Router,
 
new_lag_member_interfaces: list[dict],
replace_index: int,
replace_index: int,
) -> State:
) -> State:
"""Check Optical levels on the trunk."""
"""Check Optical POST levels on the trunk."""
extra_vars = {"wfo_ip_trunk_json": json.loads(json_dumps(subscription)), "check": "optical"}
extra_vars = {
 
"wfo_ip_trunk_json": json.loads(json_dumps(subscription)),
 
"new_node": json.loads(json_dumps(new_node)),
 
"new_lag_member_interfaces": new_lag_member_interfaces,
 
"replace_index": replace_index,
 
"check": "optical_post",
 
}
execute_playbook(
execute_playbook(
playbook_name="iptrunks_checks.yaml",
playbook_name="iptrunks_checks.yaml",
callback_route=callback_route,
callback_route=callback_route,
inventory=subscription.iptrunk.iptrunk_sides[1 - replace_index].iptrunk_side_node.router_fqdn,
inventory=f"{subscription.iptrunk.iptrunk_sides[1 - replace_index].iptrunk_side_node.router_fqdn}\n"
 
f"{new_node.router.router_fqdn}\n",
extra_vars=extra_vars,
extra_vars=extra_vars,
)
)
@@ -709,13 +734,13 @@ def migrate_iptrunk() -> StepList:
@@ -709,13 +734,13 @@ def migrate_iptrunk() -> StepList:
>> new_side_is_nokia(netbox_reserve_interfaces)
>> new_side_is_nokia(netbox_reserve_interfaces)
>> calculate_old_side_data
>> calculate_old_side_data
>> lso_interaction(set_isis_to_max)
>> lso_interaction(set_isis_to_max)
>> lso_interaction(check_ip_trunk_optical_levels)
>> lso_interaction(check_ip_trunk_optical_levels_pre)
>> lso_interaction(disable_old_config_dry)
>> lso_interaction(disable_old_config_dry)
>> lso_interaction(disable_old_config_real)
>> lso_interaction(disable_old_config_real)
>> lso_interaction(deploy_new_config_dry)
>> lso_interaction(deploy_new_config_dry)
>> lso_interaction(deploy_new_config_real)
>> lso_interaction(deploy_new_config_real)
>> confirm_continue_move_fiber
>> confirm_continue_move_fiber
>> lso_interaction(check_ip_trunk_optical_levels)
>> lso_interaction(check_ip_trunk_optical_levels_post)
>> lso_interaction(check_ip_trunk_connectivity)
>> lso_interaction(check_ip_trunk_connectivity)
>> lso_interaction(deploy_new_isis)
>> lso_interaction(deploy_new_isis)
>> lso_interaction(check_ip_trunk_isis)
>> lso_interaction(check_ip_trunk_isis)
Loading