From 04db724936aba5c0dadcc365b7db812a9cba38f1 Mon Sep 17 00:00:00 2001 From: JJ Asghar Date: Wed, 9 Jul 2014 13:35:24 -0500 Subject: [PATCH] Updating Berks to 2.0.18 This is to resolve the broken berks config with the supermarket push. This also fixes the strainerfile for the issue with the location of the gems and running bundle exec. Removed the spec_helper code for strainer to work, and updated chefspec. Also ran rubocop on this, there were a touch of changes. Change-Id: I91e9259eb2a34ed4fa01935d7cf75c0946ad9cba --- Gemfile | 6 +- Gemfile.lock | 147 ++++++++++++++++++------------------- Strainerfile | 8 +- metadata.rb | 32 ++++---- recipes/api-cfn.rb | 12 +-- recipes/api-cloudwatch.rb | 12 +-- recipes/api.rb | 12 +-- recipes/common.rb | 20 ++--- spec/common-redhat_spec.rb | 10 +-- spec/spec_helper.rb | 9 +-- 10 files changed, 133 insertions(+), 135 deletions(-) diff --git a/Gemfile b/Gemfile index 86dcd42..aa65f87 100644 --- a/Gemfile +++ b/Gemfile @@ -3,8 +3,10 @@ source 'https://rubygems.org' gem 'chef', '~> 11.8' gem 'json', '<= 1.7.7' # chef 11 dependency -gem 'berkshelf', '~> 2.0.10' -gem 'chefspec', '~> 3.1.4' +gem 'berkshelf', '~> 2.0.18' +gem 'chefspec', '~> 3.4.0' gem 'foodcritic', '~> 3.0.3' gem 'strainer' gem 'rubocop', '~> 0.18.1' +gem 'hashie', '~> 2.0' +gem 'rspec', '~> 2.14.1' diff --git a/Gemfile.lock b/Gemfile.lock index b6f6331..61f9aad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,26 +1,26 @@ GEM remote: https://rubygems.org/ specs: - activesupport (3.2.16) + activesupport (3.2.19) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - addressable (2.3.5) - akami (1.2.0) + addressable (2.3.6) + akami (1.2.2) gyoku (>= 0.4.0) - nokogiri (>= 1.4.0) - ast (1.1.0) - berkshelf (2.0.10) + nokogiri + ast (2.0.0) + berkshelf (2.0.18) activesupport (~> 3.2.0) addressable (~> 2.3.4) buff-shell_out (~> 0.1) chozo (>= 0.6.1) - faraday (>= 0.8.5) - hashie (>= 2.0.2) + faraday (~> 0.8.5) + hashie (~> 2.0) minitar (~> 0.5.4) rbzip2 (~> 0.2.0) retryable (~> 1.3.3) - ridley (~> 1.5.0) - solve (>= 0.5.0) + ridley (~> 1.7.0) + solve (~> 0.8.2) thor (~> 0.18.0) buff-config (0.4.0) buff-extensions (~> 0.3) @@ -32,40 +32,37 @@ GEM buff-shell_out (0.1.1) buff-ruby_engine (~> 0.1.0) builder (3.2.2) - celluloid (0.14.1) - timers (>= 1.0.0) - celluloid-io (0.14.1) - celluloid (>= 0.14.1) - nio4r (>= 0.4.5) - chef (11.8.2) - chef-zero (~> 1.6, >= 1.6.2) + celluloid (0.15.2) + timers (~> 1.1.0) + celluloid-io (0.15.0) + celluloid (>= 0.15.0) + nio4r (>= 0.5.0) + chef (11.12.8) + chef-zero (>= 2.0.2, < 2.1) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) highline (~> 1.6, >= 1.6.9) - json (>= 1.4.4, <= 1.7.7) + json (>= 1.4.4, <= 1.8.1) mime-types (~> 1.16) mixlib-authentication (~> 1.3) - mixlib-cli (~> 1.3) + mixlib-cli (~> 1.4) mixlib-config (~> 2.0) mixlib-log (~> 1.3) - mixlib-shellout (~> 1.2) + mixlib-shellout (~> 1.4) net-ssh (~> 2.6) - net-ssh-multi (~> 1.1.0) - ohai (~> 6.0) + net-ssh-multi (~> 1.1) + ohai (~> 7.0.4) pry (~> 0.9) - puma (~> 1.6) rest-client (>= 1.0.4, < 1.7.0) yajl-ruby (~> 1.1) - chef-zero (1.7.2) + chef-zero (2.0.2) hashie (~> 2.0) json mixlib-log (~> 1.3) - moneta (< 0.7.0) rack - chefspec (3.1.4) + chefspec (3.4.0) chef (~> 11.0) fauxhai (~> 2.0) - i18n (>= 0.6.9, < 1.0.0) rspec (~> 2.14) chozo (0.6.1) activesupport (>= 3.2.0) @@ -74,9 +71,9 @@ GEM coderay (1.1.0) diff-lcs (1.2.5) erubis (2.7.0) - faraday (0.8.8) + faraday (0.8.9) multipart-post (~> 1.2.0) - fauxhai (2.0.1) + fauxhai (2.1.2) net-ssh ohai ffi (1.9.3) @@ -91,76 +88,77 @@ GEM multi_json (~> 1.3) gssapi (1.0.3) ffi (>= 1.0.1) - gyoku (1.1.0) + gyoku (1.1.1) builder (>= 2.1.2) - hashie (2.0.5) - highline (1.6.20) - httpclient (2.3.4.1) + hashie (2.1.2) + highline (1.6.21) + httpclient (2.4.0) httpi (0.9.7) rack - i18n (0.6.9) + i18n (0.6.11) ipaddress (0.8.0) json (1.7.7) little-plugger (1.1.3) - logging (1.8.1) + logging (1.8.2) little-plugger (>= 1.1.3) - multi_json (>= 1.3.6) + multi_json (>= 1.8.4) method_source (0.8.2) mime-types (1.25.1) minitar (0.5.4) mixlib-authentication (1.3.0) mixlib-log - mixlib-cli (1.4.0) + mixlib-cli (1.5.0) mixlib-config (2.1.0) mixlib-log (1.6.0) - mixlib-shellout (1.3.0) - moneta (0.6.0) - multi_json (1.8.2) + mixlib-shellout (1.4.0) + multi_json (1.10.1) multipart-post (1.2.0) - net-http-persistent (2.9) - net-ssh (2.7.0) + net-http-persistent (2.9.4) + net-ssh (2.9.1) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) - net-ssh-multi (1.1) - net-ssh (>= 2.1.4) - net-ssh-gateway (>= 0.99.0) - nio4r (0.5.0) + net-ssh-multi (1.2.0) + net-ssh (>= 2.6.5) + net-ssh-gateway (>= 1.2.0) + nio4r (1.0.0) nokogiri (1.5.11) nori (1.1.5) - ohai (6.20.0) + ohai (7.0.4) ipaddress + mime-types (~> 1.16) mixlib-cli - mixlib-config + mixlib-config (~> 2.0) mixlib-log - mixlib-shellout + mixlib-shellout (~> 1.2) systemu (~> 2.5.2) yajl-ruby - parser (2.1.4) - ast (~> 1.1) + parser (2.1.9) + ast (>= 1.1, < 3.0) slop (~> 3.4, >= 3.4.5) - polyglot (0.3.3) + polyglot (0.3.5) powerpack (0.0.9) - pry (0.9.12.4) - coderay (~> 1.0) - method_source (~> 0.8) + pry (0.10.0) + coderay (~> 1.1.0) + method_source (~> 0.8.1) slop (~> 3.4) - puma (1.6.3) - rack (~> 1.2) rack (1.5.2) rainbow (2.0.0) - rake (10.1.1) + rake (10.3.2) rbzip2 (0.2.0) - rest-client (1.6.7) - mime-types (>= 1.16) - retryable (1.3.3) - ridley (1.5.3) + rdoc (4.1.1) + json (~> 1.4) + rest-client (1.6.8) + mime-types (~> 1.16) + rdoc (>= 2.4.2) + retryable (1.3.5) + ridley (1.7.1) addressable buff-config (~> 0.2) buff-extensions (~> 0.3) buff-ignore (~> 1.1) buff-shell_out (~> 0.1) - celluloid (~> 0.14.0) - celluloid-io (~> 0.14.0) + celluloid (~> 0.15) + celluloid-io (~> 0.15) erubis faraday (>= 0.8.4) hashie (>= 2.0.2) @@ -168,7 +166,6 @@ GEM mixlib-authentication (>= 1.3.0) net-http-persistent (>= 2.8) net-ssh - nio4r (>= 0.5.0) retryable solve (>= 0.4.4) varia_model (~> 0.1) @@ -177,10 +174,10 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - rspec-core (2.14.7) - rspec-expectations (2.14.4) + rspec-core (2.14.8) + rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.4) + rspec-mocks (2.14.6) rubocop (0.18.1) json (>= 1.7.7, < 2) parser (~> 2.1.3) @@ -195,10 +192,10 @@ GEM nokogiri (>= 1.4.0) nori (~> 1.0) wasabi (~> 1.0) - slop (3.4.7) + slop (3.5.0) solve (0.8.2) - strainer (3.3.0) - berkshelf (~> 2.0) + strainer (3.4.0) + berkshelf (>= 2.0, < 4.0) buff-platform (~> 0.1) systemu (2.5.2) thor (0.18.1) @@ -207,7 +204,7 @@ GEM polyglot polyglot (>= 0.3.1) uuidtools (2.1.4) - varia_model (0.2.0) + varia_model (0.3.2) buff-extensions (~> 0.2) hashie (>= 2.0.2) wasabi (1.0.0) @@ -226,10 +223,12 @@ PLATFORMS ruby DEPENDENCIES - berkshelf (~> 2.0.10) + berkshelf (~> 2.0.18) chef (~> 11.8) - chefspec (~> 3.1.4) + chefspec (~> 3.4.0) foodcritic (~> 3.0.3) + hashie (~> 2.0) json (<= 1.7.7) + rspec (~> 2.14.1) rubocop (~> 0.18.1) strainer diff --git a/Strainerfile b/Strainerfile index 44e3e14..cf2ff52 100644 --- a/Strainerfile +++ b/Strainerfile @@ -1,5 +1,5 @@ # Strainerfile -rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK -knife test: bundle exec knife cookbook test $COOKBOOK -foodcritic: bundle exec foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK -chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec +rubocop: rubocop $SANDBOX/$COOKBOOK +knife test: knife cookbook test $COOKBOOK +foodcritic: foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK +chefspec: rspec $SANDBOX/$COOKBOOK/spec diff --git a/metadata.rb b/metadata.rb index a92fa00..28bfe18 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,21 +1,21 @@ # encoding: UTF-8 -name 'openstack-orchestration' -maintainer 'IBM, Inc.' -license 'Apache 2.0' -description 'Installs and configures the Heat Service' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '8.1.2' -recipe 'openstack-orchestration::api', 'Start and configure the Heat API service' -recipe 'openstack-orchestration::api-cfn', 'Start and configure the Heat API CloudFormation service' -recipe 'openstack-orchestration::api-cloudwatch', 'Start and configure the Heat API CloudWatch service' -recipe 'openstack-orchestration::client', 'Installs packages for heat client' -recipe 'openstack-orchestration::common', 'Installs packages and configures a Heat Server' -recipe 'openstack-orchestration::engine', 'Sets up Heat database and starts Heat Engine service' -recipe 'openstack-orchestration::identity_registration', 'Registers Heat service, user and endpoints with Keystone' +name 'openstack-orchestration' +maintainer 'IBM, Inc.' +license 'Apache 2.0' +description 'Installs and configures the Heat Service' +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +version '8.1.2' +recipe 'openstack-orchestration::api', 'Start and configure the Heat API service' +recipe 'openstack-orchestration::api-cfn', 'Start and configure the Heat API CloudFormation service' +recipe 'openstack-orchestration::api-cloudwatch', 'Start and configure the Heat API CloudWatch service' +recipe 'openstack-orchestration::client', 'Installs packages for heat client' +recipe 'openstack-orchestration::common', 'Installs packages and configures a Heat Server' +recipe 'openstack-orchestration::engine', 'Sets up Heat database and starts Heat Engine service' +recipe 'openstack-orchestration::identity_registration', 'Registers Heat service, user and endpoints with Keystone' -%w{ ubuntu fedora redhat centos }.each do |os| +%w(ubuntu fedora redhat centos).each do |os| supports os end -depends 'openstack-common', '~> 8.0' -depends 'openstack-identity', '~> 8.0' +depends 'openstack-common', '~> 8.0' +depends 'openstack-identity', '~> 8.0' diff --git a/recipes/api-cfn.rb b/recipes/api-cfn.rb index 7399724..6e2fb35 100644 --- a/recipes/api-cfn.rb +++ b/recipes/api-cfn.rb @@ -40,16 +40,16 @@ end template '/etc/heat/api-paste.ini' do source 'api-paste.ini.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api-cfn]', :immediately end template '/etc/heat/policy.json' do source 'policy.json.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api-cfn]', :immediately end diff --git a/recipes/api-cloudwatch.rb b/recipes/api-cloudwatch.rb index 3073ff7..003a830 100644 --- a/recipes/api-cloudwatch.rb +++ b/recipes/api-cloudwatch.rb @@ -44,16 +44,16 @@ end template '/etc/heat/api-paste.ini' do source 'api-paste.ini.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api-cloudwatch]', :immediately end template '/etc/heat/policy.json' do source 'policy.json.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api-cloudwatch]', :immediately end diff --git a/recipes/api.rb b/recipes/api.rb index 1a13a34..5f1c9b3 100644 --- a/recipes/api.rb +++ b/recipes/api.rb @@ -40,16 +40,16 @@ end template '/etc/heat/api-paste.ini' do source 'api-paste.ini.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api]', :immediately end template '/etc/heat/policy.json' do source 'policy.json.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 notifies :restart, 'service[heat-api]', :immediately end diff --git a/recipes/common.rb b/recipes/common.rb index d455cfa..703f587 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -73,15 +73,15 @@ elsif mq_service_type == 'qpid' end directory '/etc/heat' do - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] mode 00700 action :create end directory '/etc/heat/environment.d' do - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] mode 00700 action :create end @@ -94,9 +94,9 @@ end template '/etc/heat/heat.conf' do source 'heat.conf.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 variables( mq_service_type: mq_service_type, mq_password: mq_password, @@ -113,9 +113,9 @@ end template '/etc/heat/environment.d/default.yaml' do source 'default.yaml.erb' - group node['openstack']['orchestration']['group'] - owner node['openstack']['orchestration']['user'] - mode 00644 + group node['openstack']['orchestration']['group'] + owner node['openstack']['orchestration']['user'] + mode 00644 end execute 'heat-manage db_sync' do diff --git a/spec/common-redhat_spec.rb b/spec/common-redhat_spec.rb index b738e3b..ddbf47a 100644 --- a/spec/common-redhat_spec.rb +++ b/spec/common-redhat_spec.rb @@ -53,7 +53,7 @@ describe 'openstack-orchestration::common' do end it 'has proper modes' do - expect(sprintf('%o', @dir.mode)).to eq '700' + expect(format('%o', @dir.mode)).to eq '700' end end @@ -68,7 +68,7 @@ describe 'openstack-orchestration::common' do end it 'has proper modes' do - expect(sprintf('%o', @dir.mode)).to eq '700' + expect(format('%o', @dir.mode)).to eq '700' end end @@ -83,7 +83,7 @@ describe 'openstack-orchestration::common' do end it 'has proper modes' do - expect(sprintf('%o', @dir.mode)).to eq '700' + expect(format('%o', @dir.mode)).to eq '700' end end @@ -97,7 +97,7 @@ describe 'openstack-orchestration::common' do end it 'has proper modes' do - expect(sprintf('%o', @template.mode)).to eq '644' + expect(format('%o', @template.mode)).to eq '644' end # Pending on https://review.openstack.org/#/c/59088/ @@ -117,7 +117,7 @@ describe 'openstack-orchestration::common' do end it 'has proper modes' do - expect(sprintf('%o', @template.mode)).to eq '644' + expect(format('%o', @template.mode)).to eq '644' end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a9e334a..af8d6b7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ # encoding: UTF-8 +require 'rspec/expectations' require 'chefspec' require 'chefspec/berkshelf' require 'chef/application' @@ -71,7 +72,7 @@ def expect_creates_api_paste(service, action = :restart) # rubocop:disable Metho end it 'has proper modes' do - expect(sprintf('%o', @template.mode)).to eq '644' + expect(format('%o', @template.mode)).to eq '644' end it 'template contents' do @@ -96,7 +97,7 @@ def expect_creates_policy_json(service, user, group, action = :restart) # ruboco end it 'has proper modes' do - expect(sprintf('%o', @template.mode)).to eq '644' + expect(format('%o', @template.mode)).to eq '644' end it 'notifies service restart' do @@ -105,8 +106,4 @@ def expect_creates_policy_json(service, user, group, action = :restart) # ruboco end end -# README(galstrom21): This will remove any coverage warnings from -# dependent cookbooks -ChefSpec::Coverage.filters << '*/openstack-orchestration' - at_exit { ChefSpec::Coverage.report! }