Skip to content
Snippets Groups Projects
Verified Commit af334eed authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Separate optical pre and post checks

parent 19d9f7e6
No related branches found
Tags 2.15
1 merge request!243Run pre and post checks when trunk capacity changes
Pipeline #88276 passed
......@@ -462,6 +462,22 @@ def allocate_interfaces_in_netbox_side_b(subscription: Iptrunk, previous_ae_memb
_netbox_allocate_interfaces(subscription.iptrunk.iptrunk_sides[1], previous_ae_members[1])
@step("Check Optical POST levels on the trunk endpoint")
def check_ip_trunk_optical_levels_post(subscription: Iptrunk, callback_route: str) -> State:
"""Check Optical POST levels on the trunk."""
extra_vars = {"wfo_ip_trunk_json": json.loads(json_dumps(subscription)), "check": "optical_post"}
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}
@workflow(
"Modify IP Trunk interface",
initial_input_form=wrap_modify_initial_input_form(initial_input_form_generator),
......@@ -494,9 +510,9 @@ def modify_trunk_interface() -> StepList:
>> store_process_subscription(Target.MODIFY)
>> unsync
>> determine_change_in_capacity
>> capacity_has_changed(lso_interaction(check_ip_trunk_lldp))
>> capacity_has_changed(lso_interaction(check_ip_trunk_optical_levels_pre))
>> capacity_has_changed(lso_interaction(check_ip_trunk_connectivity))
>> capacity_has_changed(lso_interaction(check_ip_trunk_lldp))
>> capacity_has_changed(lso_interaction(check_ip_trunk_isis))
>> modify_iptrunk_subscription
>> side_a_is_nokia(netbox_update_interfaces_side_a)
......@@ -505,9 +521,9 @@ def modify_trunk_interface() -> StepList:
>> lso_interaction(provision_ip_trunk_iface_real)
>> side_a_is_nokia(allocate_interfaces_in_netbox_side_a)
>> side_b_is_nokia(allocate_interfaces_in_netbox_side_b)
>> capacity_has_changed(lso_interaction(check_ip_trunk_optical_levels_pre))
>> capacity_has_changed(lso_interaction(check_ip_trunk_connectivity))
>> capacity_has_changed(lso_interaction(check_ip_trunk_lldp))
>> capacity_has_changed(lso_interaction(check_ip_trunk_optical_levels_post))
>> capacity_has_changed(lso_interaction(check_ip_trunk_connectivity))
>> capacity_has_changed(lso_interaction(check_ip_trunk_isis))
>> resync
>> done
......
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