From abd687f5d8681143f4e338a6ae6ba51569112a70 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Wed, 16 Jul 2014 10:15:34 +0900 Subject: [PATCH] Add log output about HTTP calls in cinderclient This patch enables heat to output the details of requests to cinder and responses from cinder (including 'x-openstack-request-id' in the response header) to the log. Change-Id: I714c87e538bc3a51dce6a48e584824cf7f954bcf Closes-bug: #1329613 --- etc/heat/heat.conf.sample | 8 ++++++++ heat/common/config.py | 5 +++-- heat/engine/clients/os/cinder.py | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/etc/heat/heat.conf.sample b/etc/heat/heat.conf.sample index 0781a9c92..3e6e6872d 100644 --- a/etc/heat/heat.conf.sample +++ b/etc/heat/heat.conf.sample @@ -631,6 +631,14 @@ #insecure=false +# +# Options defined in heat.common.config +# + +# Allow client's debug log output. (boolean value) +#http_log_debug=false + + [clients_glance] # diff --git a/heat/common/config.py b/heat/common/config.py index fc51ed104..40aeca1f5 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -180,7 +180,7 @@ heat_client_opts = [ help=_('Optional heat url in format like' ' http://0.0.0.0:8004/v1/%(tenant_id)s.'))] -nova_client_opts = [ +client_http_log_debug_opts = [ cfg.BoolOpt('http_log_debug', default=False, help=_("Allow client's debug log output."))] @@ -210,7 +210,8 @@ def list_opts(): yield client_specific_group, clients_opts yield 'clients_heat', heat_client_opts - yield 'clients_nova', nova_client_opts + yield 'clients_nova', client_http_log_debug_opts + yield 'clients_cinder', client_http_log_debug_opts cfg.CONF.register_group(paste_deploy_group) diff --git a/heat/engine/clients/os/cinder.py b/heat/engine/clients/os/cinder.py index 912730ae1..26880243e 100644 --- a/heat/engine/clients/os/cinder.py +++ b/heat/engine/clients/os/cinder.py @@ -32,6 +32,8 @@ class CinderClientPlugin(client_plugin.ClientPlugin): 'username': None, 'api_key': None, 'endpoint_type': endpoint_type, + 'http_log_debug': self._get_client_option('cinder', + 'http_log_debug'), 'cacert': self._get_client_option('cinder', 'ca_file'), 'insecure': self._get_client_option('cinder', 'insecure') }