Merge "replace string format arguments with function parameters"

This commit is contained in:
Jenkins 2016-02-13 03:27:27 +00:00 committed by Gerrit Code Review
commit 6db36064f5
8 changed files with 16 additions and 16 deletions

View File

@ -476,7 +476,7 @@ class API(base.Base):
'scheduled_at': timeutils.utcnow(), 'scheduled_at': timeutils.utcnow(),
}) })
LOG.debug("Manage: Found shares %s" % len(shares)) LOG.debug("Manage: Found shares %s.", len(shares))
retry_states = (constants.STATUS_MANAGE_ERROR,) retry_states = (constants.STATUS_MANAGE_ERROR,)

View File

@ -543,7 +543,7 @@ class ShareDriver(object):
'new_instance_id': new_share_instance['id']}) 'new_instance_id': new_share_instance['id']})
raise exception.ShareMigrationFailed(reason=msg) raise exception.ShareMigrationFailed(reason=msg)
LOG.debug("Copying completed in migration for share %s." % share['id']) LOG.debug("Copying completed in migration for share %s.", share['id'])
def create_share(self, context, share, share_server=None): def create_share(self, context, share, share_server=None):
"""Is called to create share.""" """Is called to create share."""

View File

@ -569,7 +569,7 @@ class ShareManager(manager.SchedulerDependentManager):
@utils.require_driver_initialized @utils.require_driver_initialized
def migrate_share(self, ctxt, share_id, host, force_host_copy=False): def migrate_share(self, ctxt, share_id, host, force_host_copy=False):
"""Migrates a share from current host to another host.""" """Migrates a share from current host to another host."""
LOG.debug("Entered migrate_share method for share %s." % share_id) LOG.debug("Entered migrate_share method for share %s.", share_id)
# NOTE(ganso): Cinder checks if driver is initialized before doing # NOTE(ganso): Cinder checks if driver is initialized before doing
# anything. This might not be needed, as this code may not be reached # anything. This might not be needed, as this code may not be reached
@ -604,7 +604,7 @@ class ShareManager(manager.SchedulerDependentManager):
dest_driver_migration_info = rpcapi.get_driver_migration_info( dest_driver_migration_info = rpcapi.get_driver_migration_info(
ctxt, share_instance, share_server) ctxt, share_instance, share_server)
LOG.debug("Calling driver migration for share %s." % share_id) LOG.debug("Calling driver migration for share %s.", share_id)
moved, model_update = self.driver.migrate_share( moved, model_update = self.driver.migrate_share(
ctxt, share_instance, host, dest_driver_migration_info) ctxt, share_instance, host, dest_driver_migration_info)
@ -625,7 +625,7 @@ class ShareManager(manager.SchedulerDependentManager):
if not moved: if not moved:
try: try:
LOG.debug("Starting generic migration " LOG.debug("Starting generic migration "
"for share %s." % share_id) "for share %s.", share_id)
moved = self._migrate_share_generic(ctxt, share_ref, host) moved = self._migrate_share_generic(ctxt, share_ref, host)
except Exception as e: except Exception as e:
@ -684,7 +684,7 @@ class ShareManager(manager.SchedulerDependentManager):
) )
LOG.debug("Time to start copying in migration" LOG.debug("Time to start copying in migration"
" for share %s." % share['id']) " for share %s.", share['id'])
share_server = self._get_share_server(context.elevated(), share_server = self._get_share_server(context.elevated(),
share_instance) share_instance)

View File

@ -263,7 +263,7 @@ class ShareMigrationHelper(object):
if readonly_support: if readonly_support:
LOG.debug("Changing all of share %s access rules " LOG.debug("Changing all of share %s access rules "
"to read-only." % self.share['id']) "to read-only.", self.share['id'])
self.add_rules_and_wait(self.context, self.share, self.add_rules_and_wait(self.context, self.share,
saved_rules, 'ro') saved_rules, 'ro')
@ -278,7 +278,7 @@ class ShareMigrationHelper(object):
self.context, self.share['id']) self.context, self.share['id'])
LOG.debug("Removing all of share %s read-only " LOG.debug("Removing all of share %s read-only "
"access rules." % self.share['id']) "access rules.", self.share['id'])
self.deny_rules_and_wait(self.context, self.share, readonly_rules) self.deny_rules_and_wait(self.context, self.share, readonly_rules)

View File

@ -99,7 +99,7 @@ def fake_execute(*cmd_parts, **kwargs):
stdout = reply[0] stdout = reply[0]
stderr = reply[1] stderr = reply[1]
LOG.debug("Reply to faked command is stdout='%(stdout)s' " LOG.debug("Reply to faked command is stdout='%(stdout)s' "
"stderr='%(stderr)s'" % {"stdout": stdout, "stderr": stderr}) "stderr='%(stderr)s'.", {"stdout": stdout, "stderr": stderr})
# Replicate the sleep call in the real function # Replicate the sleep call in the real function
greenthread.sleep(0) greenthread.sleep(0)

View File

@ -122,7 +122,7 @@ class TestOpenStackClient(object):
headers=headers) headers=headers)
http_status = response.status http_status = response.status
LOG.debug("%(auth_uri)s => code %(http_status)s" % LOG.debug("%(auth_uri)s => code %(http_status)s.",
{"auth_uri": auth_uri, "http_status": http_status}) {"auth_uri": auth_uri, "http_status": http_status})
if http_status == 401: if http_status == 401:
@ -148,7 +148,7 @@ class TestOpenStackClient(object):
response = self.request(full_uri, **kwargs) response = self.request(full_uri, **kwargs)
http_status = response.status http_status = response.status
LOG.debug("%(relative_uri)s => code %(http_status)s" % LOG.debug("%(relative_uri)s => code %(http_status)s.",
{"relative_uri": relative_uri, "http_status": http_status}) {"relative_uri": relative_uri, "http_status": http_status})
if check_response_status: if check_response_status:
@ -166,7 +166,7 @@ class TestOpenStackClient(object):
def _decode_json(self, response): def _decode_json(self, response):
body = response.read() body = response.read()
LOG.debug("Decoding JSON: %s" % (body)) LOG.debug("Decoding JSON: %s.", (body))
if body: if body:
return jsonutils.loads(body) return jsonutils.loads(body)
else: else:

View File

@ -54,7 +54,7 @@ def generate_new_element(items, prefix, numeric=False):
candidate = prefix + generate_random_alphanumeric(8) candidate = prefix + generate_random_alphanumeric(8)
if candidate not in items: if candidate not in items:
return candidate return candidate
LOG.debug("Random collision on %s" % candidate) LOG.debug("Random collision on %s.", candidate)
class _IntegratedTestBase(test.TestCase): class _IntegratedTestBase(test.TestCase):
@ -109,7 +109,7 @@ class _IntegratedTestBase(test.TestCase):
server = {} server = {}
image = self.api.get_images()[0] image = self.api.get_images()[0]
LOG.debug("Image: %s" % image) LOG.debug("Image: %s.", image)
if 'imageRef' in image: if 'imageRef' in image:
image_href = image['imageRef'] image_href = image['imageRef']
@ -122,7 +122,7 @@ class _IntegratedTestBase(test.TestCase):
# Set a valid flavorId # Set a valid flavorId
flavor = self.api.get_flavors()[0] flavor = self.api.get_flavors()[0]
LOG.debug("Using flavor: %s" % flavor) LOG.debug("Using flavor: %s.", flavor)
server['flavorRef'] = 'http://fake.server/%s' % flavor['id'] server['flavorRef'] = 'http://fake.server/%s' % flavor['id']
# Set a valid server name # Set a valid server name

View File

@ -35,5 +35,5 @@ class ExtensionsTest(integrated_helpers._IntegratedTestBase):
"""Simple check that fox-n-socks works.""" """Simple check that fox-n-socks works."""
response = self.api.api_request('/foxnsocks') response = self.api.api_request('/foxnsocks')
foxnsocks = response.read() foxnsocks = response.read()
LOG.debug("foxnsocks: %s" % foxnsocks) LOG.debug("foxnsocks: %s.", foxnsocks)
self.assertEqual(six.b('Try to say this Mr. Knox, sir...'), foxnsocks) self.assertEqual(six.b('Try to say this Mr. Knox, sir...'), foxnsocks)