Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Install pytz library along with graphite.
Browse files Browse the repository at this point in the history
  • Loading branch information
alext committed Oct 6, 2015
1 parent 8ff8e73 commit 07cd2f4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
# Optional: Carbon package name
#
# [*graphite_web_pkg_name*]
# Optional: Grpahite-Web package name
# Optional: Graphite-Web package name
#
# [*pytz_pkg_name*]
# Optional: pytz package name
#
class graphite(
$admin_password = $graphite::params::admin_password,
Expand All @@ -107,6 +110,7 @@
$whisper_pkg_name = 'whisper',
$carbon_pkg_name = 'carbon',
$graphite_web_pkg_name = 'graphite-web',
$pytz_pkg_name = 'pytz',
) inherits graphite::params {
validate_string(
$admin_password,
Expand Down
16 changes: 14 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$carbon = $::graphite::carbon_pkg_name
$whisper = $::graphite::whisper_pkg_name
$graphite_web = $::graphite::graphite_web_pkg_name
$pytz = $::graphite::pytz_pkg_name
$ver = $::graphite::version

if $::graphite::use_python_pip {
Expand All @@ -27,10 +28,21 @@
environment => ["PYTHONPATH=${root_dir}/lib:${root_dir}/webapp"],
install_args => "--install-option=\"--prefix=${root_dir}\" --install-option=\"--install-lib=${root_dir}/webapp\""
}
python::pip { [
$pytz,
]:
ensure => latest,
virtualenv => $root_dir,
environment => ["PYTHONPATH=${root_dir}/lib:${root_dir}/webapp"],
install_args => "--install-option=\"--prefix=${root_dir}\" --install-option=\"--install-lib=${root_dir}/lib\""
}
}
else {
package { [$carbon, $graphite_web, $whisper]:
ensure => $ver,
package {
[$carbon, $graphite_web, $whisper]:
ensure => $ver;
$pytz:
ensure => latest;
}
}

Expand Down
8 changes: 8 additions & 0 deletions spec/classes/graphite/graphite__install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
it_should_behave_like "pip_package", "whisper"
it_should_behave_like "pip_package", "carbon"
it_should_behave_like "pip_package", "graphite-web"
it {
should contain_python__pip("pytz")
.with_ensure('latest')
.with_virtualenv('/this/is/root')
.with_environment(["PYTHONPATH=/this/is/root/lib:/this/is/root/webapp"])
}
end
end

Expand All @@ -29,11 +35,13 @@
:whisper_pkg_name => 'python-whisper',
:carbon_pkg_name => 'python-carbon',
:graphite_web_pkg_name => 'python-graphite-web',
:pytz_package_name => 'python-pytz',
}}

it { should contain_package('python-whisper').with_ensure('1.2.3') }
it { should contain_package('python-carbon').with_ensure('1.2.3') }
it { should contain_package('python-graphite-web').with_ensure('1.2.3') }
it { should contain_package('python-pytz').with_ensure('latest') }
end

end

0 comments on commit 07cd2f4

Please sign in to comment.