Skip to content
Snippets Groups Projects

Run pre and post checks when trunk capacity changes

Merged Karel van Klink requested to merge feature/iptrunk-capacity-add-checks into develop
1 file
+ 17
1
Compare changes
  • Side-by-side
  • Inline
@@ -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),
@@ -505,7 +521,7 @@ 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_optical_levels_post))
>> 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))
Loading