mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit
1e510be55b
1 changed files with 10 additions and 8 deletions
|
@ -16,7 +16,7 @@ from salt.exceptions import CommandExecutionError
|
|||
# Import 3rd-party libs
|
||||
import yaml
|
||||
import salt.ext.six as six
|
||||
|
||||
from salt.ext.six.moves import range
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -157,16 +157,18 @@ def run(*args, **kwargs):
|
|||
_check_puppet()
|
||||
puppet = _Puppet()
|
||||
|
||||
if args:
|
||||
# new args tuple to filter out agent/apply for _Puppet.arguments()
|
||||
buildargs = ()
|
||||
for arg in range(len(args)):
|
||||
# based on puppet documentation action must come first. making the same
|
||||
# assertion. need to ensure the list of supported cmds here matches
|
||||
# those defined in _Puppet.arguments()
|
||||
if args[0] in ['agent', 'apply']:
|
||||
puppet.subcmd = args[0]
|
||||
puppet.arguments(args[1:])
|
||||
else:
|
||||
# args will exist as an empty list even if none have been provided
|
||||
puppet.arguments(args)
|
||||
if args[arg] in ['agent', 'apply']:
|
||||
puppet.subcmd = args[arg]
|
||||
else:
|
||||
buildargs += (args[arg],)
|
||||
# args will exist as an empty list even if none have been provided
|
||||
puppet.arguments(buildargs)
|
||||
|
||||
puppet.kwargs.update(salt.utils.clean_kwargs(**kwargs))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue