Merge pull request #20344 from jfindlay/fix_npm_names

allow upper case letters in npm package names
This commit is contained in:
Joseph Hall 2015-02-05 12:20:53 -07:00
commit 66b27d9c6c
2 changed files with 11 additions and 2 deletions

View File

@ -10,3 +10,8 @@ Version 2014.7.2 is a bugfix release for :doc:`2014.7.0
- Fix erroneous warnings for systemd service enabled check (:issue:`19606`)
- Fix FreeBSD kernel module loading, listing, and persistence
:mod:`kmod <salt.modules.freebsdkmod>` (:issue:`197151`, :issue:`19682`)
- Allow case-sensitive npm package names in the :py:mod:`npm state
<salt.states.npm>`. This may break behavior for people expecting the state
to lowercase their npm package names for them. The :py:mod:`npm module
<salt.modules.npm>` was never affected by mandatory lowercasing.
(:issue:`20329`)

View File

@ -55,6 +55,10 @@ def installed(name,
name
The package to install
.. versionchanged:: 2014.7.2
This parameter is no longer lowercased by salt so that
case-sensitive NPM package names will work.
pkgs
A list of packages to install with a single npm invocation; specifying
this argument will ignore the ``name`` argument
@ -128,14 +132,14 @@ def installed(name,
ret['comment'] = 'Error looking up {0!r}: {1}'.format(name, err)
return ret
else:
installed_pkgs = dict((p.lower(), info)
installed_pkgs = dict((p, info)
for p, info in installed_pkgs.items())
pkgs_satisfied = []
pkgs_to_install = []
for pkg in pkg_list:
pkg_name, _, pkg_ver = pkg.partition('@')
pkg_name = pkg_name.strip().lower()
pkg_name = pkg_name.strip()
if force_reinstall is True:
pkgs_to_install.append(pkg)