Skip to content
Snippets Groups Projects
Commit 4a6aba58 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov Committed by Aleksandr Kurbatov
Browse files

migrate_iptrunk: optical checks

Optical checks split into 2 parts now:
- PRE
- POST
Hence 2 different functions for pre and post with diff args.
parent 8760c67a
No related branches found
Tags 2.13
1 merge request!206migrate_iptrunk: optical checks
......@@ -222,19 +222,47 @@ def calculate_old_side_data(subscription: Iptrunk, replace_index: int) -> State:
return {"old_side_data": old_side_data}
@step("Check Optical levels on the trunk endpoint")
def check_ip_trunk_optical_levels(
@step("Check Optical PRE levels on the trunk endpoint")
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,
callback_route: str,
new_node: Router,
new_lag_member_interfaces: list[dict],
replace_index: int,
) -> State:
"""Check Optical levels on the trunk."""
extra_vars = {"wfo_ip_trunk_json": json.loads(json_dumps(subscription)), "check": "optical"}
"""Check Optical POST levels on the trunk."""
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(
playbook_name="iptrunks_checks.yaml",
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,
)
......@@ -709,13 +737,13 @@ def migrate_iptrunk() -> StepList:
>> new_side_is_nokia(netbox_reserve_interfaces)
>> calculate_old_side_data
>> 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_real)
>> lso_interaction(deploy_new_config_dry)
>> lso_interaction(deploy_new_config_real)
>> 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(deploy_new_isis)
>> lso_interaction(check_ip_trunk_isis)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment