Skip to content

Commit fde674b

Browse files
authored
Merge pull request voxpupuli#299 from ghoneycutt/strict_vars
Strict vars
2 parents d3e091b + 803642d commit fde674b

File tree

9 files changed

+22
-11
lines changed

9 files changed

+22
-11
lines changed

.fixtures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ fixtures:
55
ref: '4.6.0'
66
'epel':
77
repo: 'git://github.com/stahnma/puppet-module-epel.git'
8-
ref: '1.0.2'
8+
ref: '1.2.2'
99
symlinks:
1010
python: "#{source_dir}"

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
- PUPPET_GEM_VERSION="~> 4.3.0"
2828
- PUPPET_GEM_VERSION="~> 4.4.0"
2929
- PUPPET_GEM_VERSION="~> 4.5.0"
30-
- PUPPET_GEM_VERSION="~> 4"
30+
- PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
3131

3232
sudo: false
3333

@@ -59,7 +59,7 @@ matrix:
5959
- rvm: 1.8.7
6060
env: PUPPET_GEM_VERSION="~> 4.5.0"
6161
- rvm: 1.8.7
62-
env: PUPPET_GEM_VERSION="~> 4"
62+
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
6363
- rvm: 2.3.1
6464
env: PUPPET_GEM_VERSION="~> 3.1.0"
6565
- rvm: 2.3.1

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
33
group :development, :test do
44
gem 'metadata-json-lint', :require => false
55
gem 'rspec-puppet', :require => false
6-
gem 'puppetlabs_spec_helper', '>= 1.1.1'
6+
gem 'puppetlabs_spec_helper', '1.1.1'
77
gem 'puppet-lint', :require => false
88
gem 'pry', :require => false
99
gem 'simplecov', :require => false

manifests/install.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@
190190

191191
$virtualenv_package = "${python}-virtualenv"
192192
} else {
193-
$virtualenv_package = $::lsbdistcodename ? {
194-
'jessie' => 'virtualenv',
195-
default => 'python-virtualenv',
193+
if $::lsbdistcodename == 'jessie' {
194+
$virtualenv_package = 'virtualenv'
195+
} else {
196+
$virtualenv_package = 'python-virtualenv'
196197
}
197198
}
198199

manifests/pyvenv.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
$environment = [],
6060
) {
6161

62+
include ::python
63+
6264
if $ensure == 'present' {
6365

6466
$virtualenv_cmd = $version ? {

manifests/requirements.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
$timeout = 1800,
8181
) {
8282

83+
include ::python
84+
8385
if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') {
8486
fail('python::pip: root user must be used when virtualenv is system')
8587
}
@@ -98,8 +100,8 @@
98100
}
99101

100102
$pip_env = $virtualenv ? {
101-
'system' => "${python::exec_prefix} pip",
102-
default => "${python::exec_prefix} ${virtualenv}/bin/pip",
103+
'system' => "${::python::exec_prefix} pip",
104+
default => "${::python::exec_prefix} ${virtualenv}/bin/pip",
103105
}
104106

105107
$proxy_flag = $proxy ? {
@@ -136,5 +138,4 @@
136138
subscribe => File[$requirements],
137139
environment => $environment,
138140
}
139-
140141
}

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
],
5555
"dependencies": [
5656
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"},
57-
{"name":"stahnma/epel","version_requirement":">= 1.0.1 < 2.0.0"}
57+
{"name":"stahnma/epel","version_requirement":">= 1.2.2 < 2.0.0"}
5858
]
5959
}

spec/classes/python_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
{
188188
:id => 'root',
189189
:kernel => 'Linux',
190+
:lsbdistcodename => nil,
190191
:osfamily => 'Suse',
191192
:operatingsystem => 'SLES',
192193
:operatingsystemrelease => '11.3',

spec/defines/pyvenv_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
describe 'python::pyvenv', :type => :define do
44
let (:title) { '/opt/env' }
5+
let (:facts) do
6+
{
7+
:lsbdistcodename => 'jessie',
8+
:osfamily => 'Debian',
9+
}
10+
end
511

612
it {
713
is_expected.to contain_file( '/opt/env')

0 commit comments

Comments
 (0)