Skip to content

Commit 2ba0e37

Browse files
committed
Merge branch '4.3.x'
2 parents e310b1f + 4c62b7a commit 2ba0e37

23 files changed

+266
-77
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
##2014-07-14 - Supported Release 4.3.1
2+
### Summary
3+
This supported release updates the metadata.json to work around upgrade behavior of the PMT.
4+
5+
#### Bugfixes
6+
- Synchronize metadata.json with PMT-generated metadata to pass checksums
7+
8+
##2014-06-27 - Supported Release 4.3.0
9+
### Summary
10+
This release is the first supported release of the stdlib 4 series. It remains
11+
backwards-compatible with the stdlib 3 series. It adds two new functions, one bugfix, and many testing updates.
12+
13+
#### Features
14+
- New `bool2str()` function
15+
- New `camalcase()` function
16+
17+
#### Bugfixes
18+
- Fix `has_interface_with()` when interfaces fact is nil
19+
20+
##2014-06-04 - Release 4.2.2
21+
### Summary
22+
23+
This release adds PE3.3 support in the metadata and fixes a few tests.
24+
125
## 2014-05-08 - Release - 4.2.1
226
### Summary
327
This release moves a stray symlink that can cause problems.

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ group :development, :test do
1818
gem 'puppet-lint', :require => false
1919
gem 'pry', :require => false
2020
gem 'simplecov', :require => false
21-
gem 'beaker', :require => false
2221
gem 'beaker-rspec', :require => false
2322
end
2423

Modulefile

Lines changed: 0 additions & 11 deletions
This file was deleted.

lib/puppet/parser/functions/has_interface_with.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module Puppet::Parser::Functions
2525
interfaces = lookupvar('interfaces')
2626

2727
# If we do not have any interfaces, then there are no requested attributes
28-
return false if (interfaces == :undefined)
28+
return false if (interfaces == :undefined || interfaces.nil?)
2929

3030
interfaces = interfaces.split(',')
3131

metadata.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
{
2+
"name": "puppetlabs-stdlib",
3+
"version": "4.3.1",
4+
"author": "puppetlabs",
5+
"summary": "Puppet Module Standard Library",
6+
"license": "Apache 2.0",
7+
"source": "git://github.com/puppetlabs/puppetlabs-stdlib",
8+
"project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
9+
"issues_url": "https://github.com/puppetlabs/puppetlabs-stdlib/issues",
210
"operatingsystem_support": [
311
{
412
"operatingsystem": "RedHat",
513
"operatingsystemrelease": [
614
"4",
715
"5",
8-
"6"
16+
"6",
17+
"7"
918
]
1019
},
1120
{
1221
"operatingsystem": "CentOS",
1322
"operatingsystemrelease": [
1423
"4",
1524
"5",
16-
"6"
25+
"6",
26+
"7"
1727
]
1828
},
1929
{
2030
"operatingsystem": "OracleLinux",
2131
"operatingsystemrelease": [
2232
"4",
2333
"5",
24-
"6"
34+
"6",
35+
"7"
2536
]
2637
},
2738
{
2839
"operatingsystem": "Scientific",
2940
"operatingsystemrelease": [
3041
"4",
3142
"5",
32-
"6"
43+
"6",
44+
"7"
3345
]
3446
},
3547
{
@@ -49,7 +61,8 @@
4961
"operatingsystem": "Ubuntu",
5062
"operatingsystemrelease": [
5163
"10.04",
52-
"12.04"
64+
"12.04",
65+
"14.04"
5366
]
5467
},
5568
{
@@ -84,22 +97,15 @@
8497
"requirements": [
8598
{
8699
"name": "pe",
87-
"version_requirement": "3.2.x"
100+
"version_requirement": "3.3.x"
88101
},
89102
{
90103
"name": "puppet",
91104
"version_requirement": ">=2.7.20 <4.0.0"
92105
}
93106
],
94-
"name": "puppetlabs-stdlib",
95-
"version": "4.2.1",
96-
"source": "git://github.com/puppetlabs/puppetlabs-stdlib",
97-
"author": "puppetlabs",
98-
"license": "Apache 2.0",
99-
"summary": "Puppet Module Standard Library",
100107
"description": "Standard Library for Puppet Modules",
101-
"project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
102108
"dependencies": [
103-
109+
104110
]
105111
}

spec/acceptance/chop_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
end
2020

2121
it 'should eat the last two characters of \r\n' do
22-
pp = <<-EOS
22+
pp = <<-'EOS'
2323
$input = "test\r\n"
2424
if size($input) != 6 {
2525
fail("Size of ${input} is not 6.")

spec/acceptance/ensure_packages_spec.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
describe 'ensure_packages function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
55
describe 'success' do
66
it 'ensure_packages a package' do
7-
apply_manifest('package { "zsh": ensure => absent, }')
7+
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
88
pp = <<-EOS
9-
$a = "zsh"
10-
ensure_packages($a)
9+
$a = "rake"
10+
ensure_packages($a,{'provider' => 'gem'})
1111
EOS
1212

13-
apply_manifest(pp, :expect_changes => true) do |r|
14-
expect(r.stdout).to match(/Package\[zsh\]\/ensure: (created|ensure changed 'purged' to 'present')/)
15-
end
13+
apply_manifest(pp, :expect_changes => true)
1614
end
1715
it 'ensures a package already declared'
1816
it 'takes defaults arguments'

spec/acceptance/ensure_resource_spec.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
describe 'ensure_resource function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
55
describe 'success' do
66
it 'ensure_resource a package' do
7-
apply_manifest('package { "zsh": ensure => absent, }')
7+
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
88
pp = <<-EOS
9-
$a = "zsh"
10-
ensure_resource('package', $a)
9+
$a = "rake"
10+
ensure_resource('package', $a, {'provider' => 'gem'})
1111
EOS
1212

13-
apply_manifest(pp, :expect_changes => true) do |r|
14-
expect(r.stdout).to match(/Package\[zsh\]\/ensure: created/)
15-
end
13+
apply_manifest(pp, :expect_changes => true)
1614
end
1715
it 'ensures a resource already declared'
1816
it 'takes defaults arguments'

spec/acceptance/fqdn_rotate_spec.rb

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,31 @@
44
describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
55
describe 'success' do
66
let(:facts_d) do
7-
if fact('is_pe') == "true"
8-
'/etc/puppetlabs/facter/facts.d'
7+
if fact('is_pe', '--puppet') == "true"
8+
if fact('osfamily') =~ /windows/i
9+
if fact('kernelmajversion').to_f < 6.0
10+
'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d'
11+
else
12+
'C:/ProgramData/PuppetLabs/facter/facts.d'
13+
end
14+
else
15+
'/etc/puppetlabs/facter/facts.d'
16+
end
917
else
1018
'/etc/facter/facts.d'
1119
end
1220
end
1321
after :each do
14-
shell("if [ -f #{facts_d}/fqdn.txt ] ; then rm #{facts_d}/fqdn.txt ; fi")
22+
shell("if [ -f '#{facts_d}/fqdn.txt' ] ; then rm '#{facts_d}/fqdn.txt' ; fi")
23+
end
24+
before :all do
25+
#No need to create on windows, PE creates by default
26+
if fact('osfamily') !~ /windows/i
27+
shell("mkdir -p '#{facts_d}'")
28+
end
1529
end
1630
it 'fqdn_rotates floats' do
17-
shell("mkdir -p #{facts_d}")
18-
shell("echo 'fqdn=fakehost.localdomain' > #{facts_d}/fqdn.txt")
31+
shell("echo fqdn=fakehost.localdomain > '#{facts_d}/fqdn.txt'")
1932
pp = <<-EOS
2033
$a = ['a','b','c','d']
2134
$o = fqdn_rotate($a)

spec/acceptance/get_module_path_spec.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33

44
describe 'get_module_path function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
55
describe 'success' do
6-
it 'get_module_paths stdlib' do
7-
pp = <<-EOS
8-
$a = $::is_pe ? {
9-
'true' => '/opt/puppet/share/puppet/modules/stdlib',
10-
'false' => '/etc/puppet/modules/stdlib',
11-
}
12-
$o = get_module_path('stdlib')
13-
if $o == $a {
14-
notify { 'output correct': }
15-
}
16-
EOS
17-
18-
apply_manifest(pp, :catch_failures => true) do |r|
19-
expect(r.stdout).to match(/Notice: output correct/)
20-
end
21-
end
226
it 'get_module_paths dne' do
237
pp = <<-EOS
248
$a = $::is_pe ? {
@@ -28,6 +12,8 @@
2812
$o = get_module_path('dne')
2913
if $o == $a {
3014
notify { 'output correct': }
15+
} else {
16+
notify { "failed; module path is '$o'": }
3117
}
3218
EOS
3319

0 commit comments

Comments
 (0)