mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #48678 from OrlandoArcapix/fix-npm-dryrun-test
Fix for issue #48677 - return clean npm.bootstrap on no changes
This commit is contained in:
commit
3e293b0513
@ -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…
Reference in New Issue
Block a user