Reorganize code

pull/48114/head
Dag Wieers 6 years ago committed by Toshio Kuratomi
parent ac2c1a89a8
commit 7de09a4652

@ -260,6 +260,30 @@ def main():
policy_group = module.params['policy_group'] policy_group = module.params['policy_group']
state = module.params['state'] state = module.params['state']
# Build child_configs dynamically
child_configs = [
dict(
infraNodeBlk=dict(
attributes=dict(
descr=leaf_node_blk_description,
name=leaf_node_blk,
from_=from_,
to_=to_,
),
),
),
]
# Add infraRsAccNodePGrp only when policy_group was defined
if policy_group is not None:
child_configs.append(dict(
infraRsAccNodePGrp=dict(
attributes=dict(
tDn='uni/infra/funcprof/accnodepgrp-{0}'.format(policy_group),
),
),
))
aci = ACIModule(module) aci = ACIModule(module)
aci.construct_url( aci.construct_url(
root_class=dict( root_class=dict(
@ -283,30 +307,6 @@ def main():
aci.get_existing() aci.get_existing()
if state == 'present': if state == 'present':
# Build child_configs dynamically
child_configs = [
dict(
infraNodeBlk=dict(
attributes=dict(
descr=leaf_node_blk_description,
name=leaf_node_blk,
from_=from_,
to_=to_,
),
),
),
]
# Add infraRsAccNodePGrp only when policy_group was defined
if policy_group is not None:
child_configs.append(dict(
infraRsAccNodePGrp=dict(
attributes=dict(
tDn='uni/infra/funcprof/accnodepgrp-{0}'.format(policy_group),
),
),
))
aci.payload( aci.payload(
aci_class='infraLeafS', aci_class='infraLeafS',
class_config=dict( class_config=dict(

Loading…
Cancel
Save