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

azure_rm_securitygroup - idempotent when args are lists #507

Merged

Conversation

tfmark
Copy link
Contributor

@tfmark tfmark commented Apr 21, 2021

SUMMARY

Attempting to fix #504

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azure_rm_securitygroup

ADDITIONAL INFORMATION

This commit hopefully has a broken unit test. second commit may fix it. Haven't figured out how to test locally 😢

edit Well my test case that should have failed, passed. but yeh. This change fixes the behaviour locally. I don't know why the test case didn't highlight the problem.

edit2 Are the tests even ran? I had a typo in the unit test and it still passed the github action...

@tfmark tfmark force-pushed the securitygroup-stringy-ports branch from 09f2949 to ba81fb2 Compare April 21, 2021 11:35
@tfmark tfmark force-pushed the securitygroup-stringy-ports branch from ba81fb2 to d962d08 Compare April 21, 2021 11:43
@@ -475,6 +475,8 @@ def compare_rules_change(old_list, new_list, purge_list):


def compare_rules(old_rule, rule):
def compare_list_rule(old_rule, rule, key):
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be even better if the compare_list_rule function were defined outside compare_rules. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following the similar example here:

def check_plural(src, dest):
. I can change, but guess it should be a static method as it doesn't need anything from the class (unless you're ignoring linter warnings about static methods?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, I will confirm with developer! Thank you very much!

@Fred-sun Fred-sun added medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged labels Apr 28, 2021
@haiyuazhang haiyuazhang merged commit 9a6037d into ansible-collections:dev May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure_rm_securitygroup doesn't show idempotent behaviour
3 participants