Skip to content

Commit

Permalink
Merge branch '4.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
hunner committed Aug 5, 2014
2 parents e310b1f + 4c62b7a commit 2ba0e37
Show file tree
Hide file tree
Showing 23 changed files with 266 additions and 77 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
##2014-07-14 - Supported Release 4.3.1
### Summary
This supported release updates the metadata.json to work around upgrade behavior of the PMT.

#### Bugfixes
- Synchronize metadata.json with PMT-generated metadata to pass checksums

##2014-06-27 - Supported Release 4.3.0
### Summary
This release is the first supported release of the stdlib 4 series. It remains
backwards-compatible with the stdlib 3 series. It adds two new functions, one bugfix, and many testing updates.

#### Features
- New `bool2str()` function
- New `camalcase()` function

#### Bugfixes
- Fix `has_interface_with()` when interfaces fact is nil

##2014-06-04 - Release 4.2.2
### Summary

This release adds PE3.3 support in the metadata and fixes a few tests.

## 2014-05-08 - Release - 4.2.1
### Summary
This release moves a stray symlink that can cause problems.
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ group :development, :test do
gem 'puppet-lint', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
end

Expand Down
11 changes: 0 additions & 11 deletions Modulefile

This file was deleted.

2 changes: 1 addition & 1 deletion lib/puppet/parser/functions/has_interface_with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Puppet::Parser::Functions
interfaces = lookupvar('interfaces')

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

interfaces = interfaces.split(',')

Expand Down
34 changes: 20 additions & 14 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
{
"name": "puppetlabs-stdlib",
"version": "4.3.1",
"author": "puppetlabs",
"summary": "Puppet Module Standard Library",
"license": "Apache 2.0",
"source": "git://github.com/puppetlabs/puppetlabs-stdlib",
"project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
"issues_url": "https://github.com/puppetlabs/puppetlabs-stdlib/issues",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"4",
"5",
"6"
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"4",
"5",
"6"
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"4",
"5",
"6"
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"4",
"5",
"6"
"6",
"7"
]
},
{
Expand All @@ -49,7 +61,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"10.04",
"12.04"
"12.04",
"14.04"
]
},
{
Expand Down Expand Up @@ -84,22 +97,15 @@
"requirements": [
{
"name": "pe",
"version_requirement": "3.2.x"
"version_requirement": "3.3.x"
},
{
"name": "puppet",
"version_requirement": ">=2.7.20 <4.0.0"
}
],
"name": "puppetlabs-stdlib",
"version": "4.2.1",
"source": "git://github.com/puppetlabs/puppetlabs-stdlib",
"author": "puppetlabs",
"license": "Apache 2.0",
"summary": "Puppet Module Standard Library",
"description": "Standard Library for Puppet Modules",
"project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
"dependencies": [

]
}
2 changes: 1 addition & 1 deletion spec/acceptance/chop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
end

it 'should eat the last two characters of \r\n' do
pp = <<-EOS
pp = <<-'EOS'
$input = "test\r\n"
if size($input) != 6 {
fail("Size of ${input} is not 6.")
Expand Down
10 changes: 4 additions & 6 deletions spec/acceptance/ensure_packages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
describe 'ensure_packages function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'ensure_packages a package' do
apply_manifest('package { "zsh": ensure => absent, }')
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
pp = <<-EOS
$a = "zsh"
ensure_packages($a)
$a = "rake"
ensure_packages($a,{'provider' => 'gem'})
EOS

apply_manifest(pp, :expect_changes => true) do |r|
expect(r.stdout).to match(/Package\[zsh\]\/ensure: (created|ensure changed 'purged' to 'present')/)
end
apply_manifest(pp, :expect_changes => true)
end
it 'ensures a package already declared'
it 'takes defaults arguments'
Expand Down
10 changes: 4 additions & 6 deletions spec/acceptance/ensure_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
describe 'ensure_resource function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'ensure_resource a package' do
apply_manifest('package { "zsh": ensure => absent, }')
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
pp = <<-EOS
$a = "zsh"
ensure_resource('package', $a)
$a = "rake"
ensure_resource('package', $a, {'provider' => 'gem'})
EOS

apply_manifest(pp, :expect_changes => true) do |r|
expect(r.stdout).to match(/Package\[zsh\]\/ensure: created/)
end
apply_manifest(pp, :expect_changes => true)
end
it 'ensures a resource already declared'
it 'takes defaults arguments'
Expand Down
23 changes: 18 additions & 5 deletions spec/acceptance/fqdn_rotate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,31 @@
describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
let(:facts_d) do
if fact('is_pe') == "true"
'/etc/puppetlabs/facter/facts.d'
if fact('is_pe', '--puppet') == "true"
if fact('osfamily') =~ /windows/i
if fact('kernelmajversion').to_f < 6.0
'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d'
else
'C:/ProgramData/PuppetLabs/facter/facts.d'
end
else
'/etc/puppetlabs/facter/facts.d'
end
else
'/etc/facter/facts.d'
end
end
after :each do
shell("if [ -f #{facts_d}/fqdn.txt ] ; then rm #{facts_d}/fqdn.txt ; fi")
shell("if [ -f '#{facts_d}/fqdn.txt' ] ; then rm '#{facts_d}/fqdn.txt' ; fi")
end
before :all do
#No need to create on windows, PE creates by default
if fact('osfamily') !~ /windows/i
shell("mkdir -p '#{facts_d}'")
end
end
it 'fqdn_rotates floats' do
shell("mkdir -p #{facts_d}")
shell("echo 'fqdn=fakehost.localdomain' > #{facts_d}/fqdn.txt")
shell("echo fqdn=fakehost.localdomain > '#{facts_d}/fqdn.txt'")
pp = <<-EOS
$a = ['a','b','c','d']
$o = fqdn_rotate($a)
Expand Down
18 changes: 2 additions & 16 deletions spec/acceptance/get_module_path_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@

describe 'get_module_path function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'get_module_paths stdlib' do
pp = <<-EOS
$a = $::is_pe ? {
'true' => '/opt/puppet/share/puppet/modules/stdlib',
'false' => '/etc/puppet/modules/stdlib',
}
$o = get_module_path('stdlib')
if $o == $a {
notify { 'output correct': }
}
EOS

apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stdout).to match(/Notice: output correct/)
end
end
it 'get_module_paths dne' do
pp = <<-EOS
$a = $::is_pe ? {
Expand All @@ -28,6 +12,8 @@
$o = get_module_path('dne')
if $o == $a {
notify { 'output correct': }
} else {
notify { "failed; module path is '$o'": }
}
EOS

Expand Down
11 changes: 5 additions & 6 deletions spec/acceptance/getparam_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@

describe 'getparam function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'getparam a package' do
it 'getparam a notify' do
pp = <<-EOS
user { "rspec":
ensure => present,
managehome => true,
notify { 'rspec':
message => 'custom rspec message',
}
$o = getparam(User['rspec'], 'managehome')
$o = getparam(Notify['rspec'], 'message')
notice(inline_template('getparam is <%= @o.inspect %>'))
EOS

apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stdout).to match(/getparam is true/)
expect(r.stdout).to match(/getparam is "custom rspec message"/)
end
end
end
Expand Down
16 changes: 13 additions & 3 deletions spec/acceptance/has_interface_with_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'has_interface_with function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'has_interface_with function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
describe 'success' do
it 'has_interface_with existing ipaddress' do
pp = <<-EOS
$a = '127.0.0.1'
$a = $::ipaddress
$o = has_interface_with('ipaddress', $a)
notice(inline_template('has_interface_with is <%= @o.inspect %>'))
EOS
Expand All @@ -27,7 +27,17 @@
end
it 'has_interface_with existing interface' do
pp = <<-EOS
$a = 'lo'
if $osfamily == 'Solaris' or $osfamily == 'Darwin' {
$a = 'lo0'
}elsif $osfamily == 'windows' {
$a = $::kernelmajversion ? {
/6\.(2|3|4)/ => 'Ethernet0',
/6\.(0|1)/ => 'Local_Area_Connection',
/5\.(1|2)/ => undef, #Broken current in facter
}
}else {
$a = 'lo'
}
$o = has_interface_with($a)
notice(inline_template('has_interface_with is <%= @o.inspect %>'))
EOS
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/has_ip_address_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'has_ip_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'has_ip_address function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
describe 'success' do
it 'has_ip_address existing ipaddress' do
pp = <<-EOS
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/has_ip_network_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'has_ip_network function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'has_ip_network function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
describe 'success' do
it 'has_ip_network existing ipaddress' do
pp = <<-EOS
Expand Down
8 changes: 5 additions & 3 deletions spec/acceptance/loadyaml_spec.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

tmpdir = default.tmpdir('stdlib')

describe 'loadyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'loadyamls array of values' do
shell('echo "---
shell("echo '---
aaa: 1
bbb: 2
ccc: 3
ddd: 4" > /testyaml.yaml')
ddd: 4' > #{tmpdir}/testyaml.yaml")
pp = <<-EOS
$o = loadyaml('/testyaml.yaml')
$o = loadyaml('#{tmpdir}/testyaml.yaml')
notice(inline_template('loadyaml[aaa] is <%= @o["aaa"].inspect %>'))
notice(inline_template('loadyaml[bbb] is <%= @o["bbb"].inspect %>'))
notice(inline_template('loadyaml[ccc] is <%= @o["ccc"].inspect %>'))
Expand Down
26 changes: 26 additions & 0 deletions spec/acceptance/nodesets/windows-2003-i386.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HOSTS:
ubuntu1204:
roles:
- master
- database
- dashboard
platform: ubuntu-12.04-amd64
template: ubuntu-1204-x86_64
hypervisor: vcloud
win2003_i386:
roles:
- agent
- default
platform: windows-2003-i386
template: win-2003-i386
hypervisor: vcloud
CONFIG:
nfs_server: none
ssh:
keys: "~/.ssh/id_rsa-acceptance"
consoleport: 443
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/
pe_dir: http://neptune.puppetlabs.lan/3.2/ci-ready/
Loading

0 comments on commit 2ba0e37

Please sign in to comment.