aci_iplpg: Support missing aep (#48001)
* aci_iplpg: Support missing aep
This commit is contained in:
parent
591b074e43
commit
d1f6ff646a
3 changed files with 124 additions and 117 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- aci_interface_policy_leaf_policy_group - Support missing aep
|
|
@ -370,6 +370,124 @@ def main():
|
|||
lagT=lag_type,
|
||||
)
|
||||
|
||||
child_configs = [
|
||||
dict(
|
||||
infraRsCdpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnCdpIfPolName=cdp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsFcIfPol=dict(
|
||||
attributes=dict(
|
||||
tnFcIfPolName=fibre_channel_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsHIfPol=dict(
|
||||
attributes=dict(
|
||||
tnFabricHIfPolName=link_level_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsL2IfPol=dict(
|
||||
attributes=dict(
|
||||
tnL2IfPolName=l2_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsL2PortSecurityPol=dict(
|
||||
attributes=dict(
|
||||
tnL2PortSecurityPolName=port_security_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsLacpPol=dict(
|
||||
attributes=dict(
|
||||
tnLacpLagPolName=port_channel_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsLldpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnLldpIfPolName=lldp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsMcpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnMcpIfPolName=mcp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsMonIfInfraPol=dict(
|
||||
attributes=dict(
|
||||
tnMonInfraPolName=monitoring_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosEgressDppIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosDppPolName=egress_data_plane_policing_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosIngressDppIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosDppPolName=ingress_data_plane_policing_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosPfcIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosPfcIfPolName=priority_flow_control_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosSdIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosSdIfPolName=slow_drain_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsStormctrlIfPol=dict(
|
||||
attributes=dict(
|
||||
tnStormctrlIfPolName=storm_control_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsStpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnStpIfPolName=stp_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
# Add infraRsattEntP binding only when aep was defined
|
||||
if aep is not None:
|
||||
child_configs.append(dict(
|
||||
infraRsAttEntP=dict(
|
||||
attributes=dict(
|
||||
tDn='uni/infra/attentp-{0}'.format(aep),
|
||||
),
|
||||
),
|
||||
))
|
||||
|
||||
aci = ACIModule(module)
|
||||
aci.construct_url(
|
||||
root_class=dict(
|
||||
|
@ -404,120 +522,7 @@ def main():
|
|||
aci.payload(
|
||||
aci_class=aci_class_name,
|
||||
class_config=class_config_dict,
|
||||
child_configs=[
|
||||
dict(
|
||||
infraRsAttEntP=dict(
|
||||
attributes=dict(
|
||||
tDn='uni/infra/attentp-{0}'.format(aep),
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsCdpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnCdpIfPolName=cdp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsFcIfPol=dict(
|
||||
attributes=dict(
|
||||
tnFcIfPolName=fibre_channel_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsHIfPol=dict(
|
||||
attributes=dict(
|
||||
tnFabricHIfPolName=link_level_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsL2IfPol=dict(
|
||||
attributes=dict(
|
||||
tnL2IfPolName=l2_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsL2PortSecurityPol=dict(
|
||||
attributes=dict(
|
||||
tnL2PortSecurityPolName=port_security_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsLacpPol=dict(
|
||||
attributes=dict(
|
||||
tnLacpLagPolName=port_channel_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsLldpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnLldpIfPolName=lldp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsMcpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnMcpIfPolName=mcp_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsMonIfInfraPol=dict(
|
||||
attributes=dict(
|
||||
tnMonInfraPolName=monitoring_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosEgressDppIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosDppPolName=egress_data_plane_policing_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosIngressDppIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosDppPolName=ingress_data_plane_policing_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosPfcIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosPfcIfPolName=priority_flow_control_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsQosSdIfPol=dict(
|
||||
attributes=dict(
|
||||
tnQosSdIfPolName=slow_drain_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsStormctrlIfPol=dict(
|
||||
attributes=dict(
|
||||
tnStormctrlIfPolName=storm_control_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
dict(
|
||||
infraRsStpIfPol=dict(
|
||||
attributes=dict(
|
||||
tnStpIfPolName=stp_interface_policy,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child_configs=child_configs,
|
||||
)
|
||||
|
||||
aci.get_diff(aci_class=aci_class_name)
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
- intf_policy_leaf_polgrp_check_mode_present is changed
|
||||
- intf_policy_leaf_polgrp_present is changed
|
||||
- intf_policy_leaf_polgrp_present.previous == []
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccBndlGrp": {"attributes": {"lagT": "link","name": "policygroupname_link"},"children": [{"infraRsAttEntP": {"attributes": {"tDn": "uni/infra/attentp-None"}}},{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccBndlGrp": {"attributes": {"lagT": "link","name": "policygroupname_link"},"children": [{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- intf_policy_leaf_polgrp_idempotent is not changed
|
||||
- intf_policy_leaf_polgrp_idempotent.sent == {}
|
||||
- intf_policy_leaf_polgrp_update is changed
|
||||
|
@ -209,7 +209,7 @@
|
|||
- intf_policy_leaf_polgrp_check_mode_present is changed
|
||||
- intf_policy_leaf_polgrp_present is changed
|
||||
- intf_policy_leaf_polgrp_present.previous == []
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccBndlGrp": {"attributes": {"lagT": "node","name": "policygroupname_node"},"children": [{"infraRsAttEntP": {"attributes": {"tDn": "uni/infra/attentp-None"}}},{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccBndlGrp": {"attributes": {"lagT": "node","name": "policygroupname_node"},"children": [{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- intf_policy_leaf_polgrp_idempotent is not changed
|
||||
- intf_policy_leaf_polgrp_idempotent.sent == {}
|
||||
- intf_policy_leaf_polgrp_update is changed
|
||||
|
@ -363,7 +363,7 @@
|
|||
- intf_policy_leaf_polgrp_check_mode_present is changed
|
||||
- intf_policy_leaf_polgrp_present is changed
|
||||
- intf_policy_leaf_polgrp_present.previous == []
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccPortGrp": {"attributes": {"name": "policygroupname_leaf"},"children": [{"infraRsAttEntP": {"attributes": {"tDn": "uni/infra/attentp-None"}}},{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- 'intf_policy_leaf_polgrp_present.sent == {"infraAccPortGrp": {"attributes": {"name": "policygroupname_leaf"},"children": [{"infraRsFcIfPol": {"attributes": {"tnFcIfPolName": "fiberchannelpolicy"}}},{"infraRsHIfPol": {"attributes": {"tnFabricHIfPolName": "linklevelpolicy"}}}]}}'
|
||||
- intf_policy_leaf_polgrp_idempotent is not changed
|
||||
- intf_policy_leaf_polgrp_idempotent.sent == {}
|
||||
- intf_policy_leaf_polgrp_update is changed
|
||||
|
|
Loading…
Reference in a new issue