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:
Nicole Thomas 2018-07-20 10:07:22 -04:00 committed by GitHub
commit 3e293b0513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)