Skip to content
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

[bugfix] Modified module implementations and documentation based off of identified issues (DCNE-160) #679

Merged
merged 10 commits into from
Aug 22, 2024

Conversation

wiebecoding
Copy link
Collaborator

No description provided.

@wiebecoding wiebecoding self-assigned this Aug 19, 2024
@wiebecoding wiebecoding added the jira-sync Sync this issue to Jira label Aug 19, 2024
plugins/modules/aci_vrf_multicast.py Show resolved Hide resolved
plugins/modules/aci_vrf_multicast.py Show resolved Hide resolved
@@ -269,6 +269,14 @@ def main():
if state == "present":
regex_url = "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"

if gui_banner is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you need to update any tests for this? If nothing failed after the change maybe the test is missing some cases that can be added.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe that there needs to be any updates to tests for this. The functionality is the same as the removed message - the reason for the change is that if no 'gui_banner' was provided, the module would fail as re.fullmatch couldn't find in 'gui_banner'. This now checks that gui_banner is defined before running the re.fullmatch. Let me know if I am missing something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the module failed when gui_banner wasn't defined and the tests still passed then that indicates there is a gap in the test cases.
Now that its fixed we should add a test case that checks for gui_banner being undefined and still working.
Just gives us the opportunity to increase our test coverage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it! I have added a test to ensure that the module failure does not occur. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tests have failed with the current code changes.

Copy link
Collaborator Author

@wiebecoding wiebecoding Aug 20, 2024

Choose a reason for hiding this comment

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

Whoops! Looks like I forgot to push the change to the text. Thanks for catching that! I will add it right now.

Comment on lines 272 to 279
if gui_banner is not None:
if re.fullmatch(regex_url, gui_banner):
is_gui_message_text = "no"
else:
is_gui_message_text = "yes"
else:
is_gui_message_text = "yes"

Copy link
Collaborator

Choose a reason for hiding this comment

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

can be reduced by
if gui_banner is not None and re.fullmatch(regex_url, gui_banner):
is_gui_message_text = "no"
else:
is_gui_message_text = "yes"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it can! Thank you!

Copy link
Collaborator Author

@wiebecoding wiebecoding left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback! I will update the PR shortly based on your feedback.

plugins/modules/aci_vrf_multicast.py Show resolved Hide resolved
Copy link
Collaborator Author

@wiebecoding wiebecoding Aug 20, 2024

Choose a reason for hiding this comment

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

Whoops! Looks like I forgot to push the change to the text. Thanks for catching that! I will add it right now.

plugins/modules/aci_vrf_multicast.py Show resolved Hide resolved
@@ -269,6 +269,14 @@ def main():
if state == "present":
regex_url = "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"

if gui_banner is not None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe that there needs to be any updates to tests for this. The functionality is the same as the removed message - the reason for the change is that if no 'gui_banner' was provided, the module would fail as re.fullmatch couldn't find in 'gui_banner'. This now checks that gui_banner is defined before running the re.fullmatch. Let me know if I am missing something.

Comment on lines 272 to 279
if gui_banner is not None:
if re.fullmatch(regex_url, gui_banner):
is_gui_message_text = "no"
else:
is_gui_message_text = "yes"
else:
is_gui_message_text = "yes"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it can! Thank you!

@wiebecoding
Copy link
Collaborator Author

wiebecoding commented Aug 20, 2024

All changed modules passed integration tests.

@github-actions github-actions bot changed the title [bugfix] Modified module implementations and documentation based off of identified issues [bugfix] Modified module implementations and documentation based off of identified issues (DCNE-160) Aug 20, 2024
Copy link
Collaborator

@samiib samiib left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@shrsr shrsr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@sajagana sajagana left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@anvitha-jain anvitha-jain left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@lhercot lhercot left a comment

Choose a reason for hiding this comment

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

LGTM

@lhercot lhercot merged commit 240e2f9 into CiscoDevNet:master Aug 22, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-sync Sync this issue to Jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants