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

Add 'noaction' flag for install/remove in the opkg execution module #50306

Merged
merged 10 commits into from
Oct 31, 2018
Prev Previous commit
Next Next commit
Rename 'noaction' to 'test' and read __opts__ too
Be compliant with Salt's terminology

Signed-off-by: Rares POP <rares.pop@ni.com>
  • Loading branch information
Rares POP committed Oct 31, 2018
commit 2bc4cf5b0264671d9bbb449d5a62b6f241ebc637
5 changes: 3 additions & 2 deletions salt/modules/opkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ def install(name=None,
to_reinstall = []
to_downgrade = []

if kwargs.get('noaction', False):
if bool(kwargs.get('test') or __opts__.get('test')):
cmd_prefix.append('--noaction')

if pkg_params is None or len(pkg_params) == 0:
return {}
elif pkg_type == 'file':
Expand Down Expand Up @@ -542,7 +543,7 @@ def remove(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
if not targets:
return {}
cmd = ['opkg', 'remove']
if kwargs.get('noaction', False):
if bool(kwargs.get('test') or __opts__.get('test')):
cmd.append('--noaction')
if kwargs.get('remove_dependencies', False):
cmd.append('--force-removal-of-dependent-packages')
Expand Down