summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <sergey@stankevi.ch>2012-11-02 12:03:27 -0700
committerSergey Stankevich <sergey@stankevi.ch>2012-11-02 12:03:27 -0700
commit91b595de937e938807d942d650dde3cd5f45f2ec (patch)
tree2138946492af09783356f79027165f96d249250a
parented137893babebabdfdb5adf44d1a52272093ce8b (diff)
parent7a05a89acab1b9844416ac42d290a66122b08539 (diff)
Merge pull request #1 from MITx/master
Fixed no HTTP proxy case. Added app_interface.
-rw-r--r--manifests/gunicorn.pp13
-rw-r--r--manifests/requirements.pp2
-rw-r--r--manifests/virtualenv.pp7
3 files changed, 14 insertions, 8 deletions
diff --git a/manifests/gunicorn.pp b/manifests/gunicorn.pp
index d328d75..2548e95 100644
--- a/manifests/gunicorn.pp
+++ b/manifests/gunicorn.pp
@@ -41,12 +41,13 @@
# Sergey Stankevich
#
define python::gunicorn (
- $ensure = present,
- $virtualenv = false,
- $mode = 'wsgi',
- $dir = false,
- $bind = false,
- $environment = false
+ $ensure = present,
+ $virtualenv = false,
+ $mode = 'wsgi',
+ $dir = false,
+ $bind = false,
+ $app_interface = 'wsgi',
+ $environment = false,
) {
# Parameter validation
diff --git a/manifests/requirements.pp b/manifests/requirements.pp
index e49c86c..b6c9b34 100644
--- a/manifests/requirements.pp
+++ b/manifests/requirements.pp
@@ -39,7 +39,7 @@ define python::requirements (
}
$req_dir = inline_template('<%= requirements.match(%r!(.+)/.+!)[1] %>')
- $req_crc = "${req_dir}/requirements.sha1"
+ $req_crc = "${requirements}.sha1"
file { $requirements:
ensure => present,
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index a5cf12b..f22f4e1 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -50,9 +50,14 @@ define python::virtualenv (
default => "--proxy=${proxy}",
}
+ $proxy_command = $proxy ? {
+ false => '',
+ default => "&& export http_proxy=${proxy}",
+ }
+
exec { "python_virtualenv_${venv_dir}":
command => "mkdir -p ${venv_dir} \
- && export http_proxy=${proxy} \
+ ${proxy_command} \
&& virtualenv -p `which ${python}` ${venv_dir} \
&& ${venv_dir}/bin/pip install ${proxy_flag} --upgrade distribute pip",
creates => $venv_dir,