Skip to content

Commit 672fde3

Browse files
author
=
committed
Add debug logs and comments
1 parent 8d75ed0 commit 672fde3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/modules/dcnm_vrf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,6 +3677,8 @@ def release_orphaned_resources(self, vrf_del_list, is_rollback=False):
36773677
- allocatedFlag is False
36783678
- entityName == vrf
36793679
- fabricName == self.fabric
3680+
- switchName is not None
3681+
- ipAddress is not None
36803682
36813683
```json
36823684
[
@@ -3730,6 +3732,9 @@ def release_orphaned_resources(self, vrf_del_list, is_rollback=False):
37303732
continue
37313733
if item.get("id") is None:
37323734
continue
3735+
# Resources with no ipAddress or switchName
3736+
# are invalid and of Fabric's scope and
3737+
# should not be attempted to be deleted here.
37333738
if not item.get("ipAddress"):
37343739
continue
37353740
if not item.get("switchName"):
@@ -3742,6 +3747,8 @@ def release_orphaned_resources(self, vrf_del_list, is_rollback=False):
37423747

37433748
if len(delete_ids) == 0:
37443749
return
3750+
msg = f"Releasing orphaned resources with IDs:{delete_ids}"
3751+
self.log.debug(msg)
37453752
self.release_resources_by_id(delete_ids)
37463753

37473754
def push_to_remote(self, is_rollback=False):
@@ -3774,6 +3781,7 @@ def push_to_remote(self, is_rollback=False):
37743781
for vrf_name in self.diff_delete:
37753782
vrf_del_list.append(vrf_name)
37763783
if vrf_del_list:
3784+
msg += f"VRF(s) to be deleted: {vrf_del_list}."
37773785
self.release_orphaned_resources(vrf_del_list, is_rollback)
37783786

37793787
self.push_diff_create(is_rollback)

0 commit comments

Comments
 (0)