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

allow-firewalld-take-multiple-input #160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunshine69
Copy link

The currentl firewalld module does not take multiple values such as
source or interface, etc..

There are many cases that we need to pass multi volume to the module
rather than flatening the input so I implement it in this PR.

This change is backward compatible, that is the behaviour wont change after this change,
an existing user uses single value will work as is.

SUMMARY
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

firewalld

ADDITIONAL INFORMATION

@sunshine69
Copy link
Author

I just dont see why the check failed - the error logs does not have it so I dont know what need to improve. Please advise.

Copy link
Contributor

@aminvakil aminvakil 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 creating this PR!

Also according to https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment "The file name should include the PR number and a description of the change."

So it should be something like 160-firewalld_multiple_input_values.yml.

changelogs/fragments/firewalld_multiple_input_values.yml Outdated Show resolved Hide resolved
@sunshine69
Copy link
Author

Thanks for creating this PR!

Also according to https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment "The file name should include the PR number and a description of the change."

So it should be something like 160-firewalld_multiple_input_values.yml.

Thanks, I did all you said and the check still failed!

@aminvakil
Copy link
Contributor

@sunshine69 That's odd, I will investigate and ask others too later today.

@tadeboro
Copy link
Contributor

tadeboro commented Apr 1, 2021

Thank you for your contribution, @sunshine69!

Sanity test fail on the pep8 check: https://51388069b44786266e9b-30750299912a16616e1da61098cd5e85.ssl.cf1.rackcdn.com/160/1d9f2183434e5a375ae4ce2a13329c72bd6c8228/check/ansible-test-sanity-docker/8c8f4de/job-output.html#l1300

As for the changelog fragment check, it seems that it only looks for the changelog addition in the last commit. So I would advise you to fix the pep8 issues, squash all your commits into one, and then force-push to your branch.

Copy link
Contributor

@tadeboro tadeboro left a comment

Choose a reason for hiding this comment

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

I went through the code and I started to wonder that maybe it would be better to convert the type: str to type: list, elements: str and then let Ansible handle the conversion.

This change would allow the user to specify:

  1. a single string like now and Ansible will convert this to a list with a single element,
  2. a list of strings, and
  3. a comma-searated string that Ansible will convert to list.

@sunshine69
Copy link
Author

I went through the code and I started to wonder that maybe it would be better to convert the type: str to type: list, elements: str and then let Ansible handle the conversion.

This change would allow the user to specify:

1. a single string like now and Ansible will convert this to a list with a single element,

2. a list of strings, and

3. a comma-searated string that Ansible will convert to list.

Wonder the benefit of this approach?
I saw some module handle that way as well, but I am not sure if it is correct way, as I think it might be not:

  • Explicit (Explicit better than Implicit) as user have too many options to type in, can be string, a list and that can make a confusion
  • A minor increase in complexity

But it might be intuitive, as first user will naturally think the input should be a list so naturally it should be a list.
And because we have to make backward compatible so we still need to allow string to be in

Don't know, but I think it is good that way, I will implement it soon.

@sunshine69 sunshine69 force-pushed the allow-firewalld-take-multiple-input branch from 1d9f218 to e82c0a9 Compare April 8, 2021 12:40
@sunshine69
Copy link
Author

Thank you for your contribution, @sunshine69!

Sanity test fail on the pep8 check: https://51388069b44786266e9b-30750299912a16616e1da61098cd5e85.ssl.cf1.rackcdn.com/160/1d9f2183434e5a375ae4ce2a13329c72bd6c8228/check/ansible-test-sanity-docker/8c8f4de/job-output.html#l1300

As for the changelog fragment check, it seems that it only looks for the changelog addition in the last commit. So I would advise you to fix the pep8 issues, squash all your commits into one, and then force-push to your branch.

Did the squash and other stuff, but I ran pep8 locally and did not see any errors like no space after , so finger crossed!

@sunshine69 sunshine69 force-pushed the allow-firewalld-take-multiple-input branch 3 times, most recently from fecd1fb to 4666670 Compare April 9, 2021 01:48
The currentl firewalld module does not take multiple values such as
`source` or `interface`, etc..

There are many cases that we need to pass multi volume to the module
rather than flatening the input so I implement it in this PR.

This change is backward compatible, that is the behaviour wont change after this change,
an existing user uses single value will work as is.
@sunshine69 sunshine69 force-pushed the allow-firewalld-take-multiple-input branch from 4666670 to 469234d Compare April 9, 2021 02:03
@sunshine69
Copy link
Author

OK Now I got stuck then. Changelog is there but it still complains that changelog does not exists.
And for all other Pep8 it is not my change causing it.

Maybe you guys need to fix the checking logic somehow - and fixing the rest of the pep8 error.

@sunshine69
Copy link
Author

Can someone please look into the build errors please?

@Akasurde
Copy link
Member

@sunshine69 I looking into the error.

@Akasurde
Copy link
Member

Akasurde commented Apr 14, 2021

@sunshine69 #168 needs to be merged before this. I re-triggered CI, will ping you once that is merged.

@Akasurde Akasurde closed this Apr 16, 2021
@Akasurde Akasurde reopened this Apr 16, 2021
@saito-hideki
Copy link
Collaborator

@sunshine69 @aminvakil @tadeboro @Akasurde
Sorry if I misunderstood. But If a new argument specification method becomes possible, wouldn't it be necessary to have an example and some integration tests?

@maxamillion
Copy link
Collaborator

Hello! Apologies for the lag time on this, if this could get some examples and test cases as mentioned in the last comment then I would gladly merge. Thank you!

@maxamillion maxamillion added the waiting_on_contributor Needs help. Feel free to engage to get things unblocked label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants