summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2018-08-03 06:21:11 -0700
committerSamuel Cassiba <s@cassiba.com>2018-08-03 06:39:18 -0700
commit681a71fb3303e03c98365b10e3b0bbbcdf7dfd16 (patch)
tree607b57347b052b7e5fc18393f295580c387a55eb
parentb27c620954c5fd2f484c112d86be7040ae2d7732 (diff)
starting rocky development patch
Notes
Notes (review): Code-Review+2: Samuel Cassiba <samuel@cassi.ba> Workflow+1: Samuel Cassiba <samuel@cassi.ba> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 04 Aug 2018 05:13:18 +0000 Reviewed-on: https://review.openstack.org/588551 Project: openstack/cookbook-openstack-block-storage Branch: refs/heads/master
-rw-r--r--.rubocop.yml2
-rw-r--r--.rubocop_todo.yml20
-rw-r--r--Berksfile2
-rw-r--r--metadata.rb8
-rw-r--r--spec/api_spec.rb2
-rw-r--r--spec/backup-redhat_spec.rb2
-rw-r--r--spec/cinder_common_spec.rb14
-rw-r--r--spec/identity_registration_spec.rb2
-rw-r--r--spec/spec_helper.rb4
-rw-r--r--spec/volume_spec.rb2
10 files changed, 40 insertions, 18 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 253be24..5e0be9f 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,3 +1,5 @@
1inherit_from: .rubocop_todo.yml
2
1AllCops: 3AllCops:
2 Include: 4 Include:
3 - metadata.rb 5 - 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 @@
1# This configuration was generated by
2# `rubocop --auto-gen-config`
3# on 2018-08-03 05:25:43 -0700 using RuboCop version 0.55.0.
4# The point is for the user to remove these configuration records
5# one by one as the offenses are removed from the code base.
6# Note that changes in the inspected code, or installation of new
7# versions of RuboCop, may require this file to be generated again.
8
9# Offense count: 2
10# Cop supports --auto-correct.
11Style/IfUnlessModifier:
12 Exclude:
13 - 'attributes/cinder_conf.rb'
14 - 'recipes/cinder-common.rb'
15
16# Offense count: 58
17# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
18# URISchemes: http, https
19Metrics/LineLength:
20 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'
9end 9end
10 10
11cookbook 'openstackclient', 11cookbook 'openstackclient',
12 github: 'cloudbau/cookbook-openstackclient' 12 git: 'https://git.openstack.org/openstack/cookbook-openstackclient'
13 13
14metadata 14metadata
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'
4license 'Apache-2.0' 4license 'Apache-2.0'
5description 'The OpenStack Advanced Volume Management service Cinder.' 5description 'The OpenStack Advanced Volume Management service Cinder.'
6long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 6long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7version '17.0.0' 7version '18.0.0'
8 8
9%w(ubuntu redhat centos).each do |os| 9%w(ubuntu redhat centos).each do |os|
10 supports os 10 supports os
11end 11end
12 12
13depends 'openstack-common', '>= 17.0.0' 13depends 'openstack-common', '>= 18.0.0'
14depends 'openstack-identity', '>= 17.0.0' 14depends 'openstack-identity', '>= 18.0.0'
15depends 'openstack-image', '>= 17.0.0' 15depends 'openstack-image', '>= 18.0.0'
16depends 'openstackclient' 16depends 'openstackclient'
17 17
18depends 'lvm' 18depends '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
31 expect(chef_run).not_to create_remote_file('/etc/cinder/policy.json') 31 expect(chef_run).not_to create_remote_file('/etc/cinder/policy.json')
32 end 32 end
33 describe 'policy file specified' do 33 describe 'policy file specified' do
34 before { node.set['openstack']['block-storage']['policyfile_url'] = 'http://server/mypolicy.json' } 34 before { node.override['openstack']['block-storage']['policyfile_url'] = 'http://server/mypolicy.json' }
35 let(:remote_policy) { chef_run.remote_file('/etc/cinder/policy.json') } 35 let(:remote_policy) { chef_run.remote_file('/etc/cinder/policy.json') }
36 36
37 it 'manages policy file when remote file is specified' do 37 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
14 14
15 describe 'enable cinder backup service' do 15 describe 'enable cinder backup service' do
16 before do 16 before do
17 node.set['openstack']['block-storage']['backup']['enabled'] = true 17 node.override['openstack']['block-storage']['backup']['enabled'] = true
18 end 18 end
19 19
20 it 'starts cinder backup' do 20 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
9 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } 9 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
10 let(:node) { runner.node } 10 let(:node) { runner.node }
11 let(:chef_run) do 11 let(:chef_run) do
12 node.set['openstack']['mq']['host'] = '127.0.0.1' 12 node.override['openstack']['mq']['host'] = '127.0.0.1'
13 node.set['openstack']['mq']['block-storage']['rabbit']['notification_topic'] = 'rabbit_topic' 13 node.override['openstack']['mq']['block-storage']['rabbit']['notification_topic'] = 'rabbit_topic'
14 14
15 runner.converge(described_recipe) 15 runner.converge(described_recipe)
16 end 16 end
@@ -94,7 +94,7 @@ describe 'openstack-block-storage::cinder-common' do
94 94
95 context 'syslog use' do 95 context 'syslog use' do
96 it 'sets the log_config value when syslog is in use' do 96 it 'sets the log_config value when syslog is in use' do
97 node.set['openstack']['block-storage']['syslog']['use'] = true 97 node.override['openstack']['block-storage']['syslog']['use'] = true
98 98
99 expect(chef_run).to render_file(file.name) 99 expect(chef_run).to render_file(file.name)
100 .with_content(%r{^log_config = /etc/openstack/logging.conf$}) 100 .with_content(%r{^log_config = /etc/openstack/logging.conf$})
@@ -131,7 +131,7 @@ describe 'openstack-block-storage::cinder-common' do
131 context 'rabbitmq as mq service' do 131 context 'rabbitmq as mq service' do
132 context 'non ha attributes' do 132 context 'non ha attributes' do
133 before do 133 before do
134 node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = false 134 node.override['openstack']['mq']['block-storage']['rabbit']['ha'] = false
135 end 135 end
136 136
137 it 'does not have a rabbit_hosts attribute' do 137 it 'does not have a rabbit_hosts attribute' do
@@ -142,14 +142,14 @@ describe 'openstack-block-storage::cinder-common' do
142 142
143 context 'lvm settings' do 143 context 'lvm settings' do
144 before do 144 before do
145 node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' 145 node.override['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver'
146 end 146 end
147 end 147 end
148 148
149 context 'commonly named volume attributes' do 149 context 'commonly named volume attributes' do
150 %w(iscsi_ip_address iscsi_port iscsi_helper volumes_dir).each do |attr| 150 %w(iscsi_ip_address iscsi_port iscsi_helper volumes_dir).each do |attr|
151 it "has volume related #{attr} attribute" do 151 it "has volume related #{attr} attribute" do
152 node.set['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value" 152 node.override['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value"
153 expect(chef_run).to render_file(file.name).with_content(/^#{attr} = common_volume_#{attr}_value$/) 153 expect(chef_run).to render_file(file.name).with_content(/^#{attr} = common_volume_#{attr}_value$/)
154 end 154 end
155 end 155 end
@@ -157,7 +157,7 @@ describe 'openstack-block-storage::cinder-common' do
157 157
158 context 'netapp ISCSI settings' do 158 context 'netapp ISCSI settings' do
159 before do 159 before do
160 node.set['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver' 160 node.override['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver'
161 end 161 end
162 end 162 end
163 end 163 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
84 end 84 end
85 85
86 it 'with custom region override' do 86 it 'with custom region override' do
87 node.set['openstack']['block-storage']['region'] = 'volumeRegion' 87 node.override['openstack']['block-storage']['region'] = 'volumeRegion'
88 expect(chef_run).to create_openstack_endpoint( 88 expect(chef_run).to create_openstack_endpoint(
89 service_type 89 service_type
90 ).with(region: 'volumeRegion') 90 ).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
64shared_examples 'common-logging' do 64shared_examples 'common-logging' do
65 context 'when syslog.use is true' do 65 context 'when syslog.use is true' do
66 before do 66 before do
67 node.set['openstack']['block-storage']['syslog']['use'] = true 67 node.override['openstack']['block-storage']['syslog']['use'] = true
68 end 68 end
69 69
70 it 'runs logging recipe if node attributes say to' do 70 it 'runs logging recipe if node attributes say to' do
@@ -74,7 +74,7 @@ shared_examples 'common-logging' do
74 74
75 context 'when syslog.use is false' do 75 context 'when syslog.use is false' do
76 before do 76 before do
77 node.set['openstack']['block-storage']['syslog']['use'] = false 77 node.override['openstack']['block-storage']['syslog']['use'] = false
78 end 78 end
79 79
80 it 'runs logging recipe if node attributes say to' do 80 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
60 end 60 end
61 61
62 it 'has ubuntu include' do 62 it 'has ubuntu include' do
63 node.set['openstack']['block-storage']['volume']['volumes_dir'] = 'volumes_dir_value' 63 node.override['openstack']['block-storage']['volume']['volumes_dir'] = 'volumes_dir_value'
64 64
65 expect(chef_run).to render_file(file.name).with_content('include /etc/tgt/conf.d/*.conf') 65 expect(chef_run).to render_file(file.name).with_content('include /etc/tgt/conf.d/*.conf')
66 expect(chef_run).not_to render_file(file.name).with_content('include volumes_dir_value/*') 66 expect(chef_run).not_to render_file(file.name).with_content('include volumes_dir_value/*')