Skip to content

Commit

Permalink
Merge branch 'release/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
heliocentric committed Jul 11, 2017
2 parents a21bc9e + d9b61ba commit 1b689f4
Show file tree
Hide file tree
Showing 32 changed files with 294 additions and 232 deletions.
26 changes: 12 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,27 @@ puppet-metadata:
unit-test-ruby-2.1:
stage: test
tags:
- docker
- beaker
image: ruby:2.1
before_script:
- vagrant up
- bundle install --path=vendor --no-binstubs
script:
- bundle install
- bundle exec rake spec
unit-test-ruby-2.2:
stage: test
tags:
- docker
image: ruby:2.2
allow_failure: true
script:
- bundle install
- bundle exec rake spec
after_script:
- vagrant destroy -f
unit-test-ruby-2.3:
stage: test
tags:
- docker
- beaker
image: ruby:2.3
allow_failure: true
before_script:
- vagrant up
- bundle install --path=vendor --no-binstubs
script:
- bundle install
- bundle exec rake spec
after_script:
- vagrant destroy -f
acceptance-test:
stage: test
tags:
Expand Down
19 changes: 5 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
---
language: ruby
sudo: true
cache: bundler
services:
- docker
- vagrant
before_script:
- ./prep_ci.sh
- bundle
bundler_args: --without development system_tests
before_install: rm Gemfile.lock || true
script:
- docker run -e LOCAL_USER_ID=1000 -it --rm -v $(pwd):/data:Z simpproject/centos:6-ruby21 bundle exec rake spec
- bundle exec rake spec
notifications:
email: false
rvm:
Expand All @@ -28,17 +26,10 @@ env:
- STRICT_VARIABLES=yes
- TRUSTED_NODE_DATA=yes
matrix:
- PUPPET_VERSION="~> 4.10.2"
- PUPPET_VERSION="~> 5.0.0"
- PUPPET_VERSION="~> 4.9.4"
- PUPPET_VERSION="~> 4.8.2"
- PUPPET_VERSION="~> 4.7.0"
- PUPPET_VERSION="~> 4.5.0"
- PUPPET_VERSION="~> 3.8.0"
- PUPPET_VERSION="~> 4.4.0"
- PUPPET_VERSION="~> 4.3.0"
- PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
matrix:
fast_finish: true
allow_failures:
- env: PUPPET_VERSION="~> 4.5.0"
- env: PUPPET_VERSION="~> 3.8.0"
- env: PUPPET_VERSION="~> 4.4.0"
- env: PUPPET_VERSION="~> 4.3.0"
- env: PUPPET_VERSION="~> 3.8.0" FUTURE_PARSER=yes
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Tue Jul 11 2017 Dylan Cochran <[email protected]> - 0.3.3
- (SIMP-3406) Fix docker containers for travisci
- (SIMP-3128) Delete .meta keys

* Tue Jul 11 2017 Dylan Cochran <[email protected]> - 0.3.2
- (SIMP-3407) Fix idempoency on acl token generation
- (SIMP-3403) Spurious 'undefined method unpack'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ group :test do
gem 'rake'
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~>4')
gem 'rspec'
gem 'rspec-puppet', :git => 'https://github.com/heliocentric/rspec-puppet.git', :ref => 'fix_call'
gem 'rspec-puppet'
gem 'puppet-strings'
gem 'hiera-puppet-helper'
gem 'puppetlabs_spec_helper'
Expand Down
10 changes: 5 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Vagrant.configure(2) do |config|
}'
}
d.ports = [
"8500:8500",
"8501:8501",
"10500:8500",
"10501:8501",
]
end
end
Expand All @@ -46,8 +46,8 @@ Vagrant.configure(2) do |config|
}'
}
d.ports = [
"8504:8500",
"8503:8501",
"10504:8500",
"10503:8501",
]
end
end
Expand All @@ -57,7 +57,7 @@ Vagrant.configure(2) do |config|
d.image = "elcolio/etcd"
d.has_ssh = false
d.ports = [
"2379:2379",
"10379:2379",
]
end
end
Expand Down
19 changes: 10 additions & 9 deletions lib/puppet/functions/libkv/atomic_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def atomic_create_v1(key,value)


def atomic_create(params)
nparams = params.dup
if (closure_scope.class.to_s == 'Puppet::Parser::Scope')
catalog = closure_scope.find_global_scope.catalog
else
Expand All @@ -61,27 +62,27 @@ def atomic_create(params)
end
end
libkv = find_libkv
if params.key?('url')
url = params['url']
if nparams.key?('url')
url = nparams['url']
else
url = call_function('lookup', 'libkv::url', { 'default_value' => 'mock://'})
end
params["url"] = url
nparams["url"] = url

if params.key?('auth')
auth = params['auth']
if nparams.key?('auth')
auth = nparams['auth']
else
auth = call_function('lookup', 'libkv::auth', { 'default_value' => nil })
end
params["auth"] = auth
if (params["softfail"] == true)
nparams["auth"] = auth
if (nparams["softfail"] == true)
begin
retval = libkv.atomic_create(url, auth, params);
retval = libkv.atomic_create(url, auth, nparams);
rescue
retval = {}
end
else
retval = libkv.atomic_create(url, auth, params);
retval = libkv.atomic_create(url, auth, nparams);
end
return retval;
end
Expand Down
19 changes: 10 additions & 9 deletions lib/puppet/functions/libkv/atomic_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def atomic_delete_v1(key,previous)


def atomic_delete(params)
nparams = params.dup
if (closure_scope.class.to_s == 'Puppet::Parser::Scope')
catalog = closure_scope.find_global_scope.catalog
else
Expand All @@ -61,27 +62,27 @@ def atomic_delete(params)
end
end
libkv = find_libkv
if params.key?('url')
url = params['url']
if nparams.key?('url')
url = nparams['url']
else
url = call_function('lookup', 'libkv::url', { 'default_value' => 'mock://'})
end
params["url"] = url
nparams["url"] = url

if params.key?('auth')
auth = params['auth']
if nparams.key?('auth')
auth = nparams['auth']
else
auth = call_function('lookup', 'libkv::auth', { 'default_value' => nil })
end
params["auth"] = auth
if (params["softfail"] == true)
nparams["auth"] = auth
if (nparams["softfail"] == true)
begin
retval = libkv.atomic_delete(url, auth, params);
retval = libkv.atomic_delete(url, auth, nparams);
rescue
retval = {}
end
else
retval = libkv.atomic_delete(url, auth, params);
retval = libkv.atomic_delete(url, auth, nparams);
end
return retval;
end
Expand Down
19 changes: 10 additions & 9 deletions lib/puppet/functions/libkv/atomic_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def atomic_get_v1(key)


def atomic_get(params)
nparams = params.dup
if (closure_scope.class.to_s == 'Puppet::Parser::Scope')
catalog = closure_scope.find_global_scope.catalog
else
Expand All @@ -57,27 +58,27 @@ def atomic_get(params)
end
end
libkv = find_libkv
if params.key?('url')
url = params['url']
if nparams.key?('url')
url = nparams['url']
else
url = call_function('lookup', 'libkv::url', { 'default_value' => 'mock://'})
end
params["url"] = url
nparams["url"] = url

if params.key?('auth')
auth = params['auth']
if nparams.key?('auth')
auth = nparams['auth']
else
auth = call_function('lookup', 'libkv::auth', { 'default_value' => nil })
end
params["auth"] = auth
if (params["softfail"] == true)
nparams["auth"] = auth
if (nparams["softfail"] == true)
begin
retval = libkv.atomic_get(url, auth, params);
retval = libkv.atomic_get(url, auth, nparams);
rescue
retval = {}
end
else
retval = libkv.atomic_get(url, auth, params);
retval = libkv.atomic_get(url, auth, nparams);
end
return retval;
end
Expand Down
19 changes: 10 additions & 9 deletions lib/puppet/functions/libkv/atomic_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def atomic_list_v1(key)


def atomic_list(params)
nparams = params.dup
if (closure_scope.class.to_s == 'Puppet::Parser::Scope')
catalog = closure_scope.find_global_scope.catalog
else
Expand All @@ -57,27 +58,27 @@ def atomic_list(params)
end
end
libkv = find_libkv
if params.key?('url')
url = params['url']
if nparams.key?('url')
url = nparams['url']
else
url = call_function('lookup', 'libkv::url', { 'default_value' => 'mock://'})
end
params["url"] = url
nparams["url"] = url

if params.key?('auth')
auth = params['auth']
if nparams.key?('auth')
auth = nparams['auth']
else
auth = call_function('lookup', 'libkv::auth', { 'default_value' => nil })
end
params["auth"] = auth
if (params["softfail"] == true)
nparams["auth"] = auth
if (nparams["softfail"] == true)
begin
retval = libkv.atomic_list(url, auth, params);
retval = libkv.atomic_list(url, auth, nparams);
rescue
retval = {}
end
else
retval = libkv.atomic_list(url, auth, params);
retval = libkv.atomic_list(url, auth, nparams);
end
return retval;
end
Expand Down
19 changes: 10 additions & 9 deletions lib/puppet/functions/libkv/atomic_put.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def atomic_put_v1(key,value,previous)


def atomic_put(params)
nparams = params.dup
if (closure_scope.class.to_s == 'Puppet::Parser::Scope')
catalog = closure_scope.find_global_scope.catalog
else
Expand All @@ -65,27 +66,27 @@ def atomic_put(params)
end
end
libkv = find_libkv
if params.key?('url')
url = params['url']
if nparams.key?('url')
url = nparams['url']
else
url = call_function('lookup', 'libkv::url', { 'default_value' => 'mock://'})
end
params["url"] = url
nparams["url"] = url

if params.key?('auth')
auth = params['auth']
if nparams.key?('auth')
auth = nparams['auth']
else
auth = call_function('lookup', 'libkv::auth', { 'default_value' => nil })
end
params["auth"] = auth
if (params["softfail"] == true)
nparams["auth"] = auth
if (nparams["softfail"] == true)
begin
retval = libkv.atomic_put(url, auth, params);
retval = libkv.atomic_put(url, auth, nparams);
rescue
retval = {}
end
else
retval = libkv.atomic_put(url, auth, params);
retval = libkv.atomic_put(url, auth, nparams);
end
return retval;
end
Expand Down
Loading

0 comments on commit 1b689f4

Please sign in to comment.