mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-20 03:40:22 -07:00
rhsm_release: improve the execution of subscription-manager (#6669)
- pass the arguments to run_command() directly as list, rather than joining the arguments to string, which run_command() will need to split again - disable the expansions of variables, as there are none Adapt the unit test to the different way run_command() is called, factorizing the kwargs for run_command() so there is less repetition. There should be no behaviour changes.
This commit is contained in:
parent
2bd8469a92
commit
74ffb29573
3 changed files with 15 additions and 8 deletions
|
@ -77,9 +77,9 @@ def _sm_release(module, *args):
|
|||
# pass args to s-m release, e.g. _sm_release(module, '--set', '0.1') becomes
|
||||
# "subscription-manager release --set 0.1"
|
||||
sm_bin = module.get_bin_path('subscription-manager', required=True)
|
||||
cmd = '{0} release {1}'.format(sm_bin, " ".join(args))
|
||||
cmd = [sm_bin, 'release'] + list(args)
|
||||
# delegate nonzero rc handling to run_command
|
||||
return module.run_command(cmd, check_rc=True)
|
||||
return module.run_command(cmd, check_rc=True, expand_user_and_vars=False)
|
||||
|
||||
|
||||
def get_release(module):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue