diff --git a/manifests/pip.pp b/manifests/pip.pp index bf987a4a..0c789033 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -8,7 +8,7 @@ # must be unique # # [*pkgname] -# name of the package. +# name of the package. If pkgname is not specified, use name (title) instead. # # [*ensure*] # present|absent. Default: present @@ -41,7 +41,7 @@ # Fotis Gimian # define python::pip ( - $pkgname = undef, + $pkgname = $name, $ensure = present, $virtualenv = 'system', $url = false, @@ -77,29 +77,23 @@ default => "--proxy=${proxy}", } - # If pkgname is not specified, use name (title) instead. - $use_pkgname = $pkgname ? { - undef => $name, - default => $pkgname - } - # Check if searching by explicit version. if $ensure =~ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.[0-9]+(\.[0-9]+)?)$/ { - $grep_regex = "^${use_pkgname}==${ensure}\$" + $grep_regex = "^${pkgname}==${ensure}\$" } else { - $grep_regex = $use_pkgname ? { - /==/ => "^${use_pkgname}\$", - default => "^${use_pkgname}==", + $grep_regex = $pkgname ? { + /==/ => "^${pkgname}\$", + default => "^${pkgname}==", } } $egg_name = $egg ? { - false => $use_pkgname, + false => $pkgname, default => $egg } $source = $url ? { - false => $use_pkgname, + false => $pkgname, default => "${url}#egg=${egg_name}", }