Browse Source

Chef 14 stable release updates and fixes

This change corrects some of the issues with resource naming[1] as well
as prunes some failing unit tests that would be obsoleted with the changes
in the service renaming[2].

[1]: https://docs.chef.io/ruby.html#use-of-hyphens
[2]: https://review.openstack.org/#/q/topic:chef_14_fixes+(status:open+OR+status:merged)

Depends-On: Ic2b6d8f1cdf719791faaebdbd7e29e789eb3f31c
Change-Id: I8efc34c220fec59826bbea51e3ebf3fbc0e5b530
Samuel Cassiba 4 months ago
parent
commit
0eec9ecac8
3 changed files with 11 additions and 9 deletions
  1. 5
    1
      recipes/openstack-db.rb
  2. 0
    3
      spec/openstack-db_spec.rb
  3. 6
    5
      spec/spec_helper.rb

+ 5
- 1
recipes/openstack-db.rb View File

@@ -23,10 +23,14 @@ class ::Chef::Recipe
23 23
 end
24 24
 
25 25
 node['openstack']['common']['services'].each do |service, project|
26
+  old_services = %w(baremetal block-storage application-catalog
27
+                    object-storage telemetry-metric)
28
+  next if old_services.include?(service)
26 29
   begin
30
+    username = node['openstack']['db'][service]['username']
27 31
     password = get_password('db', project)
28 32
     openstack_common_database service do
29
-      user node['openstack']['db'][service]['username']
33
+      user username
30 34
       pass password
31 35
     end
32 36
   rescue Net::HTTPServerException, ChefVault::Exceptions::KeysNotFound

+ 0
- 3
spec/openstack-db_spec.rb View File

@@ -11,15 +11,12 @@ describe 'openstack-ops-database::openstack-db' do
11 11
 
12 12
     it 'creates all openstack service databases and the corresponding users' do
13 13
       {
14
-        'bare-metal' => 'ironic',
15
-        'block-storage' => 'cinder',
16 14
         'compute' => 'nova',
17 15
         'dashboard' => 'horizon',
18 16
         'database' => 'trove',
19 17
         'identity' => 'keystone',
20 18
         'image' => 'glance',
21 19
         'network' => 'neutron',
22
-        'object-storage' => 'swift',
23 20
         'orchestration' => 'heat',
24 21
         'telemetry' => 'ceilometer',
25 22
       }.each do |service, _project|

+ 6
- 5
spec/spec_helper.rb View File

@@ -2,18 +2,19 @@
2 2
 require 'chefspec'
3 3
 require 'chefspec/berkshelf'
4 4
 
5
-ChefSpec::Coverage.start! { add_filter 'openstack-ops-database' }
5
+RSpec.configure do |config|
6
+  config.color = true
7
+  config.formatter = :documentation
8
+  config.log_level = :fatal
9
+end
6 10
 
7
-LOG_LEVEL = :fatal
8 11
 REDHAT_OPTS = {
9 12
   platform: 'redhat',
10
-  version: '7.3',
11
-  log_level: ::LOG_LEVEL,
13
+  version: '7.4',
12 14
 }.freeze
13 15
 UBUNTU_OPTS = {
14 16
   platform: 'ubuntu',
15 17
   version: '16.04',
16
-  log_level: ::LOG_LEVEL,
17 18
 }.freeze
18 19
 
19 20
 shared_context 'database-stubs' do

Loading…
Cancel
Save