Browse Source

Add NoSQL support for metering.

When NoSQL is used, ceilometer db sync is not required.

Change-Id: I568baf73d95311d895cbd59119688495a0b879dc
Implements: blueprint metering-nosql-support
tags/eol-havana
ericzhou 5 years ago
parent
commit
dc647a3283
5 changed files with 17 additions and 5 deletions
  1. 4
    0
      CHANGELOG.md
  2. 1
    1
      README.md
  3. 2
    2
      metadata.rb
  4. 4
    2
      recipes/collector.rb
  5. 6
    0
      spec/collector_spec.rb

+ 4
- 0
CHANGELOG.md View File

@@ -2,6 +2,10 @@ openstack-metering Cookbook CHANGELOG
2 2
 ==============================
3 3
 This file is used to list changes made in each version of the openstack-metering cookbook.
4 4
 
5
+## 8.2.0
6
+### Blueprint
7
+* Add NoSQL support for metering.
8
+
5 9
 ## 8.1.0
6 10
 * Add client recipe
7 11
 

+ 1
- 1
README.md View File

@@ -34,7 +34,7 @@ client
34 34
 
35 35
 collector
36 36
 ----
37
-- Installs nova network service.
37
+- Installs collector package and service. If the NoSQL database is used for metering service, ceilometer-dbsync will not be executed.
38 38
 
39 39
 common
40 40
 ----

+ 2
- 2
metadata.rb View File

@@ -4,13 +4,13 @@ maintainer_email 'cookbooks@lists.tfoundry.com'
4 4
 license          'Apache 2.0'
5 5
 description      'The OpenStack Metering service Ceilometer.'
6 6
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
-version          '8.1.0'
7
+version          '8.2.0'
8 8
 
9 9
 recipe 'openstack-metering::agent-central', 'Installs agent central service.'
10 10
 recipe 'openstack-metering::agent-compute', 'Installs agent compute service.'
11 11
 recipe 'openstack-metering::api', 'Installs API service.'
12 12
 recipe 'openstack-metering::client', 'Installs client.'
13
-recipe 'openstack-metering::collector', 'Installs nova network service.'
13
+recipe 'openstack-metering::collector', 'Installs collector service. If the NoSQL database is used for metering service, ceilometer-dbsync will not be executed.'
14 14
 recipe 'openstack-metering::common', 'Common metering configuration.'
15 15
 recipe 'openstack-metering::identity_registration', 'Registers the endpoints with Keystone'
16 16
 

+ 4
- 2
recipes/collector.rb View File

@@ -24,8 +24,10 @@ include_recipe 'openstack-metering::common'
24 24
 
25 25
 conf_switch = "--config-file #{node["openstack"]["metering"]["conf"]}"
26 26
 
27
-execute 'database migration' do
28
-  command "ceilometer-dbsync #{conf_switch}"
27
+unless node['openstack']['db']['metering']['nosql']['used']
28
+  execute 'database migration' do
29
+    command "ceilometer-dbsync #{conf_switch}"
30
+  end
29 31
 end
30 32
 
31 33
 platform = node['openstack']['metering']['platform']

+ 6
- 0
spec/collector_spec.rb View File

@@ -16,6 +16,12 @@ describe 'openstack-metering::collector' do
16 16
       expect(@chef_run).to run_execute command
17 17
     end
18 18
 
19
+    it 'does not execute ceilometer dbsync when nosql database is used' do
20
+      @chef_run.node.set['openstack']['db']['metering']['nosql']['used'] = true
21
+      resource = 'execute[database migration]'
22
+      expect(@chef_run).not_to run_execute resource
23
+    end
24
+
19 25
     it 'installs python-mysqldb', A: true do
20 26
       expect(@chef_run).to install_package 'python-mysqldb'
21 27
     end

Loading…
Cancel
Save