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

Use None rather than Empty list #296

Merged
merged 2 commits into from
Mar 14, 2023
Merged

Conversation

marcfiu
Copy link
Contributor

@marcfiu marcfiu commented Feb 17, 2023

📝 Description

Another untested case for firewall updates yielded improper handling of rules that had either no ipv4 or ipv6 addresses. The code would default to an empty list, while the API wants None in that case.

What does this PR do and why is this change necessary?

Default to None to represent an empty IPvX list in rules.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

How do I run the relevant unit/integration tests?

use included firewall_update/main.yaml test

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.

@marcfiu
Copy link
Contributor Author

marcfiu commented Feb 17, 2023

While it is fine to handle here, it would be nicer if the linode api would handle empty lists in this case and set it to None automatically.

@lgarber-akamai
Copy link
Contributor

/acctest tests=firewall_update sha=35f54c118edb767c90e22f8e9b0c95714e2e7eed

@zliang-akamai
Copy link
Member

zliang-akamai commented Feb 22, 2023

While it is fine to handle here, it would be nicer if the linode api would handle empty lists in this case and set it to None automatically.

@marcfiu Did you have a chance to notify the Linode API team about this issue? And please let us know when this PR is ready to review as it is still a draft PR.

@lgarber-akamai lgarber-akamai marked this pull request as ready for review March 13, 2023 14:48
@lgarber-akamai
Copy link
Contributor

/acctest tests=firewall_update sha=08be018c0881ae434ba21a200717006fa1c01d41

@marcfiu
Copy link
Contributor Author

marcfiu commented Mar 13, 2023

@zliang-akamai : the changes are ready for review.

Btw., I have not contacted the Linode API team on treating [] as None in this case. I will consider doing so.

@lgarber-akamai lgarber-akamai changed the base branch from main to dev March 13, 2023 15:50
@lgarber-akamai lgarber-akamai merged commit 9556a95 into linode:dev Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants