summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Stankevich <stankevich@users.noreply.github.com>2013-12-19 10:12:28 -0800
committerSergey Stankevich <stankevich@users.noreply.github.com>2013-12-19 10:12:28 -0800
commitde7c5b770adba8e6846a57f8f538617593234d8d (patch)
treecb285dba53706f32e681595485313cc8d41fd416
parente92b2d2a7e1b20925a71d34dc83cd3bfa760fbf2 (diff)
parent535115b9d1426a4d380dc4631fdd2944e0c29e88 (diff)
Merge pull request #45 from zeebox/lintfix
Fixing lint issues
-rw-r--r--manifests/config.pp18
-rw-r--r--manifests/install.pp15
-rw-r--r--manifests/pip.pp20
-rw-r--r--manifests/virtualenv.pp12
4 files changed, 47 insertions, 18 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index 49e5230..52c10be 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,3 +1,18 @@
+# == Define: python::config
+#
+# Optionally installs the gunicorn service
+#
+# === Examples
+#
+# include python::config
+#
+# === Authors
+#
+# Sergey Stankevich
+# Ashley Penney
+# Fotis Gimian
+#
+
class python::config {
Class['python::install'] -> Python::Pip <| |>
@@ -19,5 +34,4 @@ class python::config {
pattern => '/usr/bin/gunicorn',
}
}
-
-}
+} \ No newline at end of file
diff --git a/manifests/install.pp b/manifests/install.pp
index 0d16659..bb5f090 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -1,3 +1,18 @@
+# == Define: python::install
+#
+# Installs core python packages
+#
+# === Examples
+#
+# include python::install
+#
+# === Authors
+#
+# Sergey Stankevich
+# Ashley Penney
+# Fotis Gimian
+#
+
class python::install {
$python = $python::version ? {
diff --git a/manifests/pip.pp b/manifests/pip.pp
index bcb7911..ebe549b 100644
--- a/manifests/pip.pp
+++ b/manifests/pip.pp
@@ -57,7 +57,7 @@ define python::pip (
$cwd = $virtualenv ? {
'system' => '/',
- default => "${virtualenv}",
+ default => $virtualenv,
}
$pip_env = $virtualenv ? {
@@ -88,26 +88,26 @@ define python::pip (
case $ensure {
present: {
exec { "pip_install_${name}":
- command => "$pip_env --log ${cwd}/pip.log install $install_args ${proxy_flag} ${source}",
- unless => "$pip_env freeze | grep -i -e ${grep_regex}",
+ command => "${pip_env} --log ${cwd}/pip.log install ${install_args} ${proxy_flag} ${source}",
+ unless => "${pip_env} freeze | grep -i -e ${grep_regex}",
user => $owner,
environment => $environment,
- path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"],
+ path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'],
}
}
latest: {
exec { "pip_install_${name}":
- command => "$pip_env --log ${cwd}/pip.log install --upgrade ${proxy_flag} ${source}",
+ command => "${pip_env} --log ${cwd}/pip.log install --upgrade ${proxy_flag} ${source}",
user => $owner,
environment => $environment,
- path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"],
+ path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'],
}
}
latest: {
exec { "pip_install_${name}":
- command => "$pip_env --log ${cwd}/pip.log install -U $install_args ${proxy_flag} ${source}",
+ command => "${pip_env} --log ${cwd}/pip.log install -U ${install_args} ${proxy_flag} ${source}",
user => $owner,
environment => $environment,
}
@@ -115,11 +115,11 @@ define python::pip (
default: {
exec { "pip_uninstall_${name}":
- command => "echo y | $pip_env uninstall $uninstall_args ${proxy_flag} ${name}",
- onlyif => "$pip_env freeze | grep -i -e ${grep_regex}",
+ command => "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name}",
+ onlyif => "${pip_env} freeze | grep -i -e ${grep_regex}",
user => $owner,
environment => $environment,
- path => ["/usr/local/bin","/usr/bin","/bin", "/usr/sbin"],
+ path => ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'],
}
}
}
diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp
index bc7141c..85fc67a 100644
--- a/manifests/virtualenv.pp
+++ b/manifests/virtualenv.pp
@@ -98,7 +98,7 @@ define python::virtualenv (
default => "&& export http_proxy=${proxy}",
}
- # Virtualenv versions prior to 1.7 do not support the
+ # Virtualenv versions prior to 1.7 do not support the
# --system-site-packages flag, default off for prior versions
# Prior to version 1.7 the default was equal to --system-site-packages
# and the flag --no-site-packages had to be passed to do the opposite
@@ -120,12 +120,12 @@ define python::virtualenv (
}
exec { "python_virtualenv_${venv_dir}":
- command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade pip ${distribute_pkg}",
- user => $owner,
- path => $path,
- cwd => "/tmp",
+ command => "mkdir -p ${venv_dir} ${proxy_command} && virtualenv ${system_pkgs_flag} -p ${python} ${venv_dir} && ${venv_dir}/bin/pip --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --upgrade pip ${distribute_pkg}",
+ user => $owner,
+ path => $path,
+ cwd => '/tmp',
environment => $environment,
- unless => "grep '^[ \t]*VIRTUAL_ENV=[\'\"]*/tmp[\"\']*[ \t]*$' /tmp/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv
+ unless => "grep '^[ \t]*VIRTUAL_ENV=[\'\"]*/tmp[\"\']*[ \t]*$' /tmp/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv
}
if $requirements {