summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <stankevich@users.noreply.github.com>2014-03-06 09:38:33 -0500
committerSergey Stankevich <stankevich@users.noreply.github.com>2014-03-06 09:38:33 -0500
commit5434eb78a45372fdfe07cb8d84ddd739bea825ce (patch)
treeea90948de31061f0457948ace98d0dad5f89092a
parent661c14e22109ccbe1d9da695b8eb05031b1e4d72 (diff)
parentc298a80bc32e3dda2e6b0d1deb839cc2831f646e (diff)
Merge pull request #65 from marcinzaremba/fix-pip-name
Same package for mutiple virtualenvs
-rw-r--r--manifests/pip.pp19
1 files changed, 13 insertions, 6 deletions
diff --git a/manifests/pip.pp b/manifests/pip.pp
index 4f91e59..7e332fe 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -4,6 +4,12 @@
#
# === Parameters
#
+# [*name]
+# must be unique
+#
+# [*pkgname]
+# name of the package.
+#
# [*ensure*]
# present|absent. Default: present
#
@@ -35,6 +41,7 @@
# Fotis Gimian
#
define python::pip (
+ $pkgname = undef,
$ensure = present,
$virtualenv = 'system',
$url = false,
@@ -70,18 +77,18 @@ define python::pip (
default => "--proxy=${proxy}",
}
- $grep_regex = $name ? {
- /==/ => "^${name}\$",
- default => "^${name}==",
+ $grep_regex = $pkgname ? {
+ /==/ => "^${pkgname}\$",
+ default => "^${pkgname}==",
}
$egg_name = $egg ? {
- false => $name,
+ false => $pkgname,
default => $egg
}
$source = $url ? {
- false => $name,
+ false => $pkgname,
default => "${url}#egg=${egg_name}",
}
@@ -122,7 +129,7 @@ define python::pip (
default: {
exec { "pip_uninstall_${name}":
- command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name}",
+ command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${pkgname}",
onlyif => "${pip_env} freeze | grep -i -e ${grep_regex}",
user => $owner,
environment => $environment,