Install correct package version, if provided, for npm state.

Fixes #23343

We already have taken care of the correct formatting for either
a list of packages, or a single package name with 'pkg_list'. Let's
use it so the version information can be passed to the install
function as well as the name.
This commit is contained in:
rallytime 2015-12-15 11:43:45 -07:00
parent f606c23ea8
commit a0ed857c37

View file

@ -186,13 +186,9 @@ def installed(name,
'runas': user,
'registry': registry,
'env': env,
'pkgs': pkg_list,
}
if pkgs is not None:
cmd_args['pkgs'] = pkgs
else:
cmd_args['pkg'] = pkg_name
call = __salt__['npm.install'](**cmd_args)
except (CommandNotFoundError, CommandExecutionError) as err:
ret['result'] = False