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
yum/dnf: fail when space separated string of names #47109
Conversation
Hi @mkrizek, thank you for submitting this pull-request! |
lib/ansible/module_utils/yumdnf.py
Outdated
@@ -98,6 +98,15 @@ def __init__(self, module): | |||
self.enablerepo = self.listify_comma_sep_strings_in_list(self.enablerepo) | |||
self.exclude = self.listify_comma_sep_strings_in_list(self.exclude) | |||
|
|||
# Fail if someone passed a space separated string | |||
# https://github.com/ansible/ansible/issues/46301 | |||
if any((' ' in name for name in self.names)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, so my assumption "who would put space in a package name?" wasn't true of course. This breaks @Development Tools
use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so a rpm package name can not contain a space, but groups can. I guess you can just add a and '@' not in name
to your conditional and that should handle it.
CI failure in integration tests: https://app.shippable.com/github/ansible/ansible/runs/88652/35/tests |
rebuild_merge |
@mkrizek I think this should be backported to |
* yum/dnf: fail when space separated string of names * Groups allow spaces in names (cherry picked from commit e8b6864)
@maxamillion Created #47414. |
* yum/dnf: fail when space separated string of names * Groups allow spaces in names
SUMMARY
@maxamillion I wonder if the failure is too much but the docs clarification is worth adding I think.
Related to #46301
ISSUE TYPE
COMPONENT NAME
yum
dnf
ANSIBLE VERSION
ADDITIONAL INFORMATION