Clean up make_client() logging

Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
This commit is contained in:
Dean Troyer 2014-07-08 01:44:55 -05:00
parent ea938e8ddf
commit 21bd4619ae
6 changed files with 11 additions and 6 deletions

View File

@ -34,7 +34,7 @@ def make_client(instance):
API_NAME,
instance._api_version[API_NAME],
API_VERSIONS)
LOG.debug('instantiating compute client: %s', compute_client)
LOG.debug('Instantiating compute client: %s', compute_client)
# Set client http_log_debug to True if verbosity level is high enough
http_log_debug = utils.get_effective_log_level() <= logging.DEBUG

View File

@ -36,8 +36,10 @@ def make_client(instance):
API_NAME,
instance._api_version[API_NAME],
API_VERSIONS)
LOG.debug('Instantiating identity client: %s' % identity_client)
if instance._url:
LOG.debug('instantiating identity client: token flow')
LOG.debug('Using token auth')
client = identity_client(
endpoint=instance._url,
token=instance._token,
@ -46,7 +48,7 @@ def make_client(instance):
trust_id=instance._trust_id,
)
else:
LOG.debug('instantiating identity client: password flow')
LOG.debug('Using password auth')
client = identity_client(
username=instance._username,
password=instance._password,

View File

@ -38,6 +38,7 @@ def make_client(instance):
API_NAME,
instance._api_version[API_NAME],
API_VERSIONS)
LOG.debug('Instantiating image client: %s', image_client)
if not instance._url:
instance._url = instance.get_endpoint_for_service_type(API_NAME)

View File

@ -32,6 +32,8 @@ def make_client(instance):
API_NAME,
instance._api_version[API_NAME],
API_VERSIONS)
LOG.debug('Instantiating network client: %s', network_client)
if not instance._url:
instance._url = instance.get_endpoint_for_service_type("network")
return network_client(

View File

@ -35,11 +35,12 @@ def make_client(instance):
API_NAME,
instance._api_version[API_NAME],
API_VERSIONS)
LOG.debug('Instantiating object client: %s' % object_client)
if instance._url:
endpoint = instance._url
else:
endpoint = instance.get_endpoint_for_service_type(API_NAME)
LOG.debug('instantiating object client')
client = object_client(
endpoint=endpoint,
token=instance._token,

View File

@ -40,8 +40,7 @@ def make_client(instance):
instance._api_version[API_NAME],
API_VERSIONS
)
LOG.debug('instantiating volume client')
LOG.debug('Instantiating volume client: %s', volume_client)
# Set client http_log_debug to True if verbosity level is high enough
http_log_debug = utils.get_effective_log_level() <= logging.DEBUG