summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <stankevich@users.noreply.github.com>2014-04-06 10:25:03 -0400
committerSergey Stankevich <stankevich@users.noreply.github.com>2014-04-06 10:25:03 -0400
commitc3a5a8f338776255859d50f4b906642f540cb162 (patch)
tree9667009776e2bd200c2a8936eadd27d5ad574965
parentd9adcb640e078b43d41d2940c07f68c6cc83de92 (diff)
parent7c7afae3abdb0924fdc362a42ad3cd60644b910e (diff)
Merge pull request #77 from igalic/patch-1
simplify pkgname default
-rw-r--r--manifests/pip.pp22
1 files changed, 8 insertions, 14 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index bf987a4..0c78903 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 @@ define python::pip (
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}",
}