File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ def main():
237237 ),
238238 subclass_1 = dict (
239239 aci_class = "fabricRsDecommissionNode" ,
240- aci_rn = "rsdecommissionNode-[topology/pod- {0}/node-{1} ]" .format (pod_id , node_id ) ,
240+ aci_rn = "rsdecommissionNode-[{0}]" .format (target_dn ) if target_dn else None ,
241241 target_filter = {"tDn" : target_dn },
242242 ),
243243 )
@@ -255,7 +255,7 @@ def main():
255255 aci .get_diff (aci_class = "fabricRsDecommissionNode" )
256256 aci .post_config ()
257257
258- elif state == "absent" : # Commission
258+ elif state == "absent" and aci . existing : # Commission
259259 # The aci.delete_config function removes the object directly from APIC, which can interrupt the commission or decommission process before it finishes.
260260 # Because of that the Fabric Node may enter a bad state.
261261 aci .payload (
@@ -265,10 +265,8 @@ def main():
265265 status = "deleted" ,
266266 ),
267267 )
268-
269- if aci .existing :
270- aci .get_diff (aci_class = "fabricRsDecommissionNode" )
271- aci .post_config ()
268+ aci .get_diff (aci_class = "fabricRsDecommissionNode" )
269+ aci .post_config ()
272270
273271 aci .exit_json ()
274272
You can’t perform that action at this time.
0 commit comments