From 681a71fb3303e03c98365b10e3b0bbbcdf7dfd16 Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Fri, 3 Aug 2018 06:21:11 -0700 Subject: [PATCH] starting rocky development patch Change-Id: I829e8e793d107b9bf6d35781480cafdb27f7a928 --- .rubocop.yml | 2 ++ .rubocop_todo.yml | 20 ++++++++++++++++++++ Berksfile | 2 +- metadata.rb | 8 ++++---- spec/api_spec.rb | 2 +- spec/backup-redhat_spec.rb | 2 +- spec/cinder_common_spec.rb | 14 +++++++------- spec/identity_registration_spec.rb | 2 +- spec/spec_helper.rb | 4 ++-- spec/volume_spec.rb | 2 +- 10 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 253be24..5e0be9f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + AllCops: Include: - metadata.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..952f3ec --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,20 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2018-08-03 05:25:43 -0700 using RuboCop version 0.55.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 2 +# Cop supports --auto-correct. +Style/IfUnlessModifier: + Exclude: + - 'attributes/cinder_conf.rb' + - 'recipes/cinder-common.rb' + +# Offense count: 58 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 141 diff --git a/Berksfile b/Berksfile index f98b519..e612c07 100644 --- a/Berksfile +++ b/Berksfile @@ -9,6 +9,6 @@ source 'https://supermarket.chef.io' end cookbook 'openstackclient', - github: 'cloudbau/cookbook-openstackclient' + git: 'https://git.openstack.org/openstack/cookbook-openstackclient' metadata diff --git a/metadata.rb b/metadata.rb index 81fdaff..5c67d7d 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,15 +4,15 @@ maintainer_email 'openstack-dev@lists.openstack.org' license 'Apache-2.0' description 'The OpenStack Advanced Volume Management service Cinder.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '17.0.0' +version '18.0.0' %w(ubuntu redhat centos).each do |os| supports os end -depends 'openstack-common', '>= 17.0.0' -depends 'openstack-identity', '>= 17.0.0' -depends 'openstack-image', '>= 17.0.0' +depends 'openstack-common', '>= 18.0.0' +depends 'openstack-identity', '>= 18.0.0' +depends 'openstack-image', '>= 18.0.0' depends 'openstackclient' depends 'lvm' diff --git a/spec/api_spec.rb b/spec/api_spec.rb index 13f9897..81a40d6 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -31,7 +31,7 @@ describe 'openstack-block-storage::api' do expect(chef_run).not_to create_remote_file('/etc/cinder/policy.json') end describe 'policy file specified' do - before { node.set['openstack']['block-storage']['policyfile_url'] = 'http://server/mypolicy.json' } + before { node.override['openstack']['block-storage']['policyfile_url'] = 'http://server/mypolicy.json' } let(:remote_policy) { chef_run.remote_file('/etc/cinder/policy.json') } it 'manages policy file when remote file is specified' do diff --git a/spec/backup-redhat_spec.rb b/spec/backup-redhat_spec.rb index 7fc940b..a06bbe1 100644 --- a/spec/backup-redhat_spec.rb +++ b/spec/backup-redhat_spec.rb @@ -14,7 +14,7 @@ describe 'openstack-block-storage::backup' do describe 'enable cinder backup service' do before do - node.set['openstack']['block-storage']['backup']['enabled'] = true + node.override['openstack']['block-storage']['backup']['enabled'] = true end it 'starts cinder backup' do diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 5182cd9..03fb06d 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -9,8 +9,8 @@ describe 'openstack-block-storage::cinder-common' do let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) do - node.set['openstack']['mq']['host'] = '127.0.0.1' - node.set['openstack']['mq']['block-storage']['rabbit']['notification_topic'] = 'rabbit_topic' + node.override['openstack']['mq']['host'] = '127.0.0.1' + node.override['openstack']['mq']['block-storage']['rabbit']['notification_topic'] = 'rabbit_topic' runner.converge(described_recipe) end @@ -94,7 +94,7 @@ describe 'openstack-block-storage::cinder-common' do context 'syslog use' do it 'sets the log_config value when syslog is in use' do - node.set['openstack']['block-storage']['syslog']['use'] = true + node.override['openstack']['block-storage']['syslog']['use'] = true expect(chef_run).to render_file(file.name) .with_content(%r{^log_config = /etc/openstack/logging.conf$}) @@ -131,7 +131,7 @@ describe 'openstack-block-storage::cinder-common' do context 'rabbitmq as mq service' do context 'non ha attributes' do before do - node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = false + node.override['openstack']['mq']['block-storage']['rabbit']['ha'] = false end it 'does not have a rabbit_hosts attribute' do @@ -142,14 +142,14 @@ describe 'openstack-block-storage::cinder-common' do context 'lvm settings' do before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' + node.override['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' end end context 'commonly named volume attributes' do %w(iscsi_ip_address iscsi_port iscsi_helper volumes_dir).each do |attr| it "has volume related #{attr} attribute" do - node.set['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value" + node.override['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value" expect(chef_run).to render_file(file.name).with_content(/^#{attr} = common_volume_#{attr}_value$/) end end @@ -157,7 +157,7 @@ describe 'openstack-block-storage::cinder-common' do context 'netapp ISCSI settings' do before do - node.set['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver' + node.override['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver' end end end diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index f53ad31..ff45034 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -84,7 +84,7 @@ describe 'openstack-block-storage::identity_registration' do end it 'with custom region override' do - node.set['openstack']['block-storage']['region'] = 'volumeRegion' + node.override['openstack']['block-storage']['region'] = 'volumeRegion' expect(chef_run).to create_openstack_endpoint( service_type ).with(region: 'volumeRegion') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 40f131f..5a04965 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -64,7 +64,7 @@ end shared_examples 'common-logging' do context 'when syslog.use is true' do before do - node.set['openstack']['block-storage']['syslog']['use'] = true + node.override['openstack']['block-storage']['syslog']['use'] = true end it 'runs logging recipe if node attributes say to' do @@ -74,7 +74,7 @@ shared_examples 'common-logging' do context 'when syslog.use is false' do before do - node.set['openstack']['block-storage']['syslog']['use'] = false + node.override['openstack']['block-storage']['syslog']['use'] = false end it 'runs logging recipe if node attributes say to' do diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index 90e6a38..24a0fb5 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -60,7 +60,7 @@ describe 'openstack-block-storage::volume' do end it 'has ubuntu include' do - node.set['openstack']['block-storage']['volume']['volumes_dir'] = 'volumes_dir_value' + node.override['openstack']['block-storage']['volume']['volumes_dir'] = 'volumes_dir_value' expect(chef_run).to render_file(file.name).with_content('include /etc/tgt/conf.d/*.conf') expect(chef_run).not_to render_file(file.name).with_content('include volumes_dir_value/*')