From 841b03ab167a8b5fbc750873b7a4e50803794a10 Mon Sep 17 00:00:00 2001 From: danehans Date: Wed, 10 Jul 2013 21:42:55 +0000 Subject: [PATCH] Add Debug Logging Support Previsouly the openstack module would use the verbose parameter for debug logging. This change adds the debug parameter that allows users to seperate debug and verbose logging levels. Defauls to false for backwards compatibility and to disable debug logging. Change-Id: I0eef4d0c7729df8ad0a7103f3f032d6c7da9def7 --- manifests/cinder/controller.pp | 2 ++ manifests/controller.pp | 7 +++++++ manifests/nova/controller.pp | 2 ++ spec/classes/openstack_cinder_controller_spec.rb | 1 + spec/classes/openstack_controller_spec.rb | 11 +++++++++-- spec/classes/openstack_nova_controller_spec.rb | 1 + spec/classes/openstack_quantum_spec.rb | 1 + 7 files changed, 23 insertions(+), 2 deletions(-) diff --git a/manifests/cinder/controller.pp b/manifests/cinder/controller.pp index 6530d22..ac354e1 100644 --- a/manifests/cinder/controller.pp +++ b/manifests/cinder/controller.pp @@ -28,6 +28,7 @@ class openstack::cinder::controller( $scheduler_driver = 'cinder.scheduler.simple.SimpleScheduler', $api_enabled = true, $scheduler_enabled = true, + $debug = false, $verbose = false ) { @@ -50,6 +51,7 @@ class openstack::cinder::controller( rabbit_virtual_host => $rabbit_virtual_host, package_ensure => $package_ensure, api_paste_config => $api_paste_config, + debug => $debug, verbose => $verbose, } diff --git a/manifests/controller.pp b/manifests/controller.pp index 7f59925..1907143 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -38,6 +38,7 @@ # Defaults to false. # [network_config] Hash that can be used to pass implementation specifc # network settings. Optioal. Defaults to {} +# [debug] Whether to log services at debug. # [verbose] Whether to log services at verbose. # Horizon related config - assumes puppetlabs-horizon code # [secret_key] secret key to encode cookies, … @@ -168,6 +169,7 @@ class openstack::controller ( $vnc_enabled = true, $vncproxy_host = false, # General + $debug = false, $verbose = false, # cinder # if the cinder management components should be installed @@ -259,6 +261,7 @@ class openstack::controller ( ####### KEYSTONE ########### class { 'openstack::keystone': + debug => $debug, verbose => $verbose, db_type => $db_type, db_host => $db_host, @@ -289,6 +292,7 @@ class openstack::controller ( ######## BEGIN GLANCE ########## class { 'openstack::glance': + debug => $debug, verbose => $verbose, db_type => $db_type, db_host => $db_host, @@ -353,6 +357,7 @@ class openstack::controller ( vnc_enabled => $vnc_enabled, vncproxy_host => $vncproxy_host_real, # General + debug => $debug, verbose => $verbose, enabled => $enabled, } @@ -402,6 +407,7 @@ class openstack::controller ( # General enabled => $enabled, enable_server => $enable_quantum_server, + debug => $debug, verbose => $verbose, } } @@ -431,6 +437,7 @@ class openstack::controller ( db_host => $db_host, api_enabled => $enabled, scheduler_enabled => $enabled, + debug => $debug, verbose => $verbose } } diff --git a/manifests/nova/controller.pp b/manifests/nova/controller.pp index e9e868c..7bc86f5 100644 --- a/manifests/nova/controller.pp +++ b/manifests/nova/controller.pp @@ -74,6 +74,7 @@ class openstack::nova::controller ( # Keystone $keystone_host = '127.0.0.1', # General + $debug = false, $verbose = false, $enabled = true ) { @@ -118,6 +119,7 @@ class openstack::nova::controller ( rabbit_virtual_host => $rabbit_virtual_host, image_service => 'nova.image.glance.GlanceImageService', glance_api_servers => $glance_connection, + debug => $debug, verbose => $verbose, rabbit_host => $rabbit_connection, } diff --git a/spec/classes/openstack_cinder_controller_spec.rb b/spec/classes/openstack_cinder_controller_spec.rb index 42a91da..085f1b5 100644 --- a/spec/classes/openstack_cinder_controller_spec.rb +++ b/spec/classes/openstack_cinder_controller_spec.rb @@ -26,6 +26,7 @@ describe 'openstack::cinder::controller' do :rabbit_virtual_host => '/', :package_ensure => 'present', :api_paste_config => '/etc/cinder/api-paste.ini', + :debug => false, :verbose => false ) should contain_class('cinder::api').with( diff --git a/spec/classes/openstack_controller_spec.rb b/spec/classes/openstack_controller_spec.rb index ea6595e..f5bd69c 100644 --- a/spec/classes/openstack_controller_spec.rb +++ b/spec/classes/openstack_controller_spec.rb @@ -314,6 +314,7 @@ describe 'openstack::controller' do let :params do default_params.merge( :verbose => false, + :debug => false, :glance_user_password => 'glance_pass2', :glance_db_password => 'glance_pass3', :db_host => '127.0.0.2', @@ -382,6 +383,7 @@ describe 'openstack::controller' do :rabbit_virtual_host => '/', :image_service => 'nova.image.glance.GlanceImageService', :glance_api_servers => '10.0.0.1:9292', + :debug => false, :verbose => false ) should contain_class('nova::api').with( @@ -465,6 +467,7 @@ describe 'openstack::controller' do end it 'should configure cinder using defaults' do should contain_class('cinder').with( + :debug => false, :verbose => false, :sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder?charset=utf8', :rabbit_password => 'rabbit_pw' @@ -477,6 +480,7 @@ describe 'openstack::controller' do context 'when overriding config' do let :params do default_params.merge( + :debug => true, :verbose => true, :rabbit_user => 'rabbituser', :rabbit_password => 'rabbit_pw2', @@ -489,6 +493,7 @@ describe 'openstack::controller' do end it 'should configure cinder using defaults' do should contain_class('cinder').with( + :debug => true, :verbose => true, :sql_connection => 'mysql://baz:bar@127.0.0.2/blah?charset=utf8', :rabbit_password => 'rabbit_pw2', @@ -507,8 +512,9 @@ describe 'openstack::controller' do let :params do default_params.merge({ - :quantum => true, - :verbose => true, + :quantum => true, + :debug => true, + :verbose => true, :quantum_user_password => 'q_pass', :bridge_interface => 'eth_27', :internal_address => '10.0.0.3', @@ -544,6 +550,7 @@ describe 'openstack::controller' do :keystone_host => '127.0.0.1', :enabled => true, :enable_server => true, + :debug => true, :verbose => true ) diff --git a/spec/classes/openstack_nova_controller_spec.rb b/spec/classes/openstack_nova_controller_spec.rb index 0aa2412..14729c0 100644 --- a/spec/classes/openstack_nova_controller_spec.rb +++ b/spec/classes/openstack_nova_controller_spec.rb @@ -38,6 +38,7 @@ describe 'openstack::nova::controller' do :rabbit_virtual_host => '/', :image_service => 'nova.image.glance.GlanceImageService', :glance_api_servers => '127.0.0.1:9292', + :debug => false, :verbose => false, :rabbit_host => '127.0.0.1' ) diff --git a/spec/classes/openstack_quantum_spec.rb b/spec/classes/openstack_quantum_spec.rb index 826008c..5feb982 100644 --- a/spec/classes/openstack_quantum_spec.rb +++ b/spec/classes/openstack_quantum_spec.rb @@ -34,6 +34,7 @@ describe 'openstack::quantum' do :rabbit_virtual_host => '/', :rabbit_user => 'rabbit_user', :rabbit_password => 'rabbit_pass', + :debug => false, :verbose => false, :debug => false )