-
Notifications
You must be signed in to change notification settings - Fork 50
Fix issue 538 create vrf wo vni #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2176,6 +2176,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 " | ||||||
|
|
@@ -2273,7 +2276,12 @@ def diff_merge_create(self, replace=False): | |||||
| } | ||||||
|
|
||||||
| if self.dcnm_version > 11: | ||||||
| template_conf.update(isRPAbsent=json_to_dict.get("isRPAbsent")) | ||||||
| template_conf.update( | ||||||
| vrfVlanId="" if template_conf["vrfVlanId"] == 0 else template_conf["vrfVlanId"] | ||||||
|
||||||
| vrfVlanId="" if template_conf["vrfVlanId"] == 0 else template_conf["vrfVlanId"] | |
| vrfVlanId="" if template_conf.get("vrfVlanId") in [0, None] else template_conf["vrfVlanId"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented the defesive check in ^9608cc6
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The inline conditional in the
update()call is difficult to read and maintain. Consider extracting this logic to a separate variable before the update:This improves readability and makes the transformation logic more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented suggestion in ^9608cc6