mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix for issue #48677 - return True when no changes are to be made with npm.bootstrap with test=true
This commit is contained in:
parent
07a1f6520f
commit
851a404f6b
1 changed files with 7 additions and 3 deletions
|
@ -275,9 +275,13 @@ def bootstrap(name, user=None, silent=True):
|
|||
if __opts__['test']:
|
||||
try:
|
||||
call = __salt__['npm.install'](dir=name, runas=user, pkg=None, silent=silent, dry_run=True)
|
||||
ret['result'] = None
|
||||
ret['changes'] = {'old': [], 'new': call}
|
||||
ret['comment'] = '{0} is set to be bootstrapped'.format(name)
|
||||
if call:
|
||||
ret['result'] = None
|
||||
ret['changes'] = {'old': [], 'new': call}
|
||||
ret['comment'] = '{0} is set to be bootstrapped'.format(name)
|
||||
else:
|
||||
ret['result'] = True
|
||||
ret['comment'] = '{0} is already bootstrapped'.format(name)
|
||||
except (CommandNotFoundError, CommandExecutionError) as err:
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Error Bootstrapping \'{0}\': {1}'.format(name, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue