File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ def main():
237
237
),
238
238
subclass_1 = dict (
239
239
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 ,
241
241
target_filter = {"tDn" : target_dn },
242
242
),
243
243
)
@@ -255,7 +255,7 @@ def main():
255
255
aci .get_diff (aci_class = "fabricRsDecommissionNode" )
256
256
aci .post_config ()
257
257
258
- elif state == "absent" : # Commission
258
+ elif state == "absent" and aci . existing : # Commission
259
259
# The aci.delete_config function removes the object directly from APIC, which can interrupt the commission or decommission process before it finishes.
260
260
# Because of that the Fabric Node may enter a bad state.
261
261
aci .payload (
@@ -265,10 +265,8 @@ def main():
265
265
status = "deleted" ,
266
266
),
267
267
)
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 ()
272
270
273
271
aci .exit_json ()
274
272
You can’t perform that action at this time.
0 commit comments