Merge "Improve logging in designate.network_api"
This commit is contained in:
commit
13262d4e0a
@ -28,7 +28,7 @@ cfg.CONF.register_opts([
|
||||
|
||||
|
||||
def get_network_api(network_api_driver):
|
||||
LOG.debug("Loading network_api driver: %s" % network_api_driver)
|
||||
LOG.debug("Loading network_api driver: %s", network_api_driver)
|
||||
|
||||
cls = NetworkAPI.get_driver(network_api_driver)
|
||||
|
||||
|
@ -57,7 +57,7 @@ class NetworkAPI(DriverPlugin):
|
||||
msg = 'No service_catalog and no configured endpoints'
|
||||
raise exceptions.ConfigurationError(msg)
|
||||
|
||||
LOG.debug('Returning endpoints: %s' % endpoints)
|
||||
LOG.debug('Returning endpoints: %s', endpoints)
|
||||
return endpoints
|
||||
|
||||
def _endpoints_from_catalog(self, service_catalog, service_type,
|
||||
|
@ -46,7 +46,7 @@ def allocate_floatingip(tenant_id, floatingip_id=None):
|
||||
|
||||
ALLOCATIONS[tenant_id][id_] = POOL.pop(id_)
|
||||
values = _format_floatingip(id_, ALLOCATIONS[tenant_id][id_])
|
||||
LOG.debug("Allocated to id_ %s to %s - %s" % (id_, tenant_id, values))
|
||||
LOG.debug("Allocated to id_ %s to %s - %s", id_, tenant_id, values)
|
||||
return values
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ def deallocate_floatingip(id_):
|
||||
"""
|
||||
Deallocate a floatingip
|
||||
"""
|
||||
LOG.debug('De-allocating %s' % id_)
|
||||
LOG.debug('De-allocating %s', id_)
|
||||
for tenant_id, allocated in list(ALLOCATIONS.items()):
|
||||
if id_ in allocated:
|
||||
POOL[id_] = allocated.pop(id_)
|
||||
@ -82,6 +82,6 @@ class FakeNetworkAPI(NetworkAPI):
|
||||
data = list(ALLOCATIONS.get(context.tenant, {}).items())
|
||||
|
||||
formatted = [_format_floatingip(k, v) for k, v in data]
|
||||
LOG.debug('Returning %i FloatingIPs: %s' %
|
||||
(len(formatted), formatted))
|
||||
LOG.debug('Returning %i FloatingIPs: %s',
|
||||
len(formatted), formatted)
|
||||
return formatted
|
||||
|
@ -110,8 +110,8 @@ class NeutronNetworkAPI(NetworkAPI):
|
||||
|
||||
def _call(endpoint, region, *args, **kw):
|
||||
client = get_client(context, endpoint=endpoint)
|
||||
LOG.debug("Attempting to fetch FloatingIPs from %s @ %s" %
|
||||
(endpoint, region))
|
||||
LOG.debug("Attempting to fetch FloatingIPs from %s @ %s",
|
||||
endpoint, region)
|
||||
try:
|
||||
fips = client.list_floatingips(*args, **kw)
|
||||
except neutron_exceptions.Unauthorized as e:
|
||||
@ -124,7 +124,7 @@ class NeutronNetworkAPI(NetworkAPI):
|
||||
return
|
||||
except Exception as e:
|
||||
LOG.error(_LE('Failed calling Neutron '
|
||||
'%(region)s - %(endpoint)s') %
|
||||
'%(region)s - %(endpoint)s'),
|
||||
{'region': region, 'endpoint': endpoint})
|
||||
LOG.exception(e)
|
||||
failed.append((e, endpoint, region))
|
||||
@ -137,8 +137,8 @@ class NeutronNetworkAPI(NetworkAPI):
|
||||
'region': region
|
||||
})
|
||||
|
||||
LOG.debug("Added %i FloatingIPs from %s @ %s" %
|
||||
(len(data), endpoint, region))
|
||||
LOG.debug("Added %i FloatingIPs from %s @ %s",
|
||||
len(data), endpoint, region)
|
||||
|
||||
for endpoint, region in endpoints:
|
||||
tg.add_thread(_call, endpoint, region,
|
||||
|
Loading…
Reference in New Issue
Block a user