Skip to content
Snippets Groups Projects
Commit 22bc9515 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 e58d1908
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !206. Comments created here will be created in the context of that merge request.
...@@ -222,19 +222,47 @@ def calculate_old_side_data(subscription: Iptrunk, replace_index: int) -> State: ...@@ -222,19 +222,47 @@ 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, subscription: Iptrunk,
callback_route: str, 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, 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 +737,13 @@ def migrate_iptrunk() -> StepList: ...@@ -709,13 +737,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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment