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

improve "koji" parameter handling #195

Open
ktdreyer opened this issue Jul 29, 2020 · 0 comments
Open

improve "koji" parameter handling #195

ktdreyer opened this issue Jul 29, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ktdreyer
Copy link
Owner

ktdreyer commented Jul 29, 2020

Our common_koji.get_profile_name() method seems to duplicate Ansible's own env_fallback() method. Maybe we could use env_fallback and drop some code / get nicer error messages? Currently get_profile_name() raises ValueError if it can't find a profile. env_fallback() will raise AnsibleFallbackNotFound, so I guess that's a tiny bit easier to catch?

From https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#fallback , it would look something like this:

koji=dict(fallback=(env_fallback, ['KOJI_PROFILE']))

Need to play around with this and see if it's viable and a net gain.

(Also, beware we have no integration tests for un-setting KOJI_PROFILE)

@ktdreyer ktdreyer changed the title try "fallback" for koji parameter improve "koji" parameter handling Jul 29, 2020
@ktdreyer ktdreyer added the enhancement New feature or request label Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant