Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion plugins/modules/dcnm_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,7 @@ def get_want(self):
if vrf.get("vlan_id"):
vlan_id = vrf.get("vlan_id")
else:
# Todo: When DCNM 11.x support is ended, change the default vlan_id to ""
vlan_id = 0

want_create.append(self.update_create_params(vrf, vlan_id))
Expand Down Expand Up @@ -2176,6 +2177,9 @@ def get_next_vrf_id(self, fabric) -> int:
msg += f"{self.dcnm_version}"
self.module.fail_json(msg)

if vrf_id is not None:
break

if vrf_id is None:
msg = f"{self.class_name}.{method_name}: "
msg += "Unable to retrieve vrf_id "
Expand Down Expand Up @@ -2273,7 +2277,13 @@ def diff_merge_create(self, replace=False):
}

if self.dcnm_version > 11:
template_conf.update(isRPAbsent=json_to_dict.get("isRPAbsent"))
vrf_vlan_id = "" if template_conf["vrfVlanId"] in [0, None] else template_conf["vrfVlanId"]
template_conf.update(
vrfVlanId=vrf_vlan_id
)
template_conf.update(
isRPAbsent=json_to_dict.get("isRPAbsent")
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the update for isRPAbsent related to creating the VRF without VNI or is it a separate issue? It's fine that it's added here, but am rather just curious about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not related. I just added the newline to standirize the elements inside the update function.

template_conf.update(
ENABLE_NETFLOW=json_to_dict.get("ENABLE_NETFLOW")
)
Expand Down