Enable some off-by-default checks
Some of the available checks are disabled by default, like: [H106] Don't put vim configuration in source files [H203] Use assertIs(Not)None to check for None [H904] Use ',' instead of '%', String interpolation should be delayed to be handled by the logging code, rather than being done at the point of the logging call. Change-Id: Ie985fcf78997a86d41e40eacbb4a5ace8592a348
This commit is contained in:
parent
af8d4cc32e
commit
b236c24a1a
@ -80,7 +80,7 @@ class RemoteClient(object):
|
|||||||
# Shell options below add more clearness on failures,
|
# Shell options below add more clearness on failures,
|
||||||
# path is extended for some non-cirros guest oses (centos7)
|
# path is extended for some non-cirros guest oses (centos7)
|
||||||
cmd = CONF.validation.ssh_shell_prologue + " " + cmd
|
cmd = CONF.validation.ssh_shell_prologue + " " + cmd
|
||||||
LOG.debug("Remote command: %s" % cmd)
|
LOG.debug("Remote command: %s", cmd)
|
||||||
return self.ssh_client.exec_command(cmd)
|
return self.ssh_client.exec_command(cmd)
|
||||||
|
|
||||||
@debug_ssh
|
@debug_ssh
|
||||||
|
@ -91,7 +91,7 @@ class handle_cleanup_exceptions(object):
|
|||||||
return False # Do not suppress error if any
|
return False # Do not suppress error if any
|
||||||
if exc_traceback:
|
if exc_traceback:
|
||||||
LOG.error("Suppressed cleanup error in Manila: "
|
LOG.error("Suppressed cleanup error in Manila: "
|
||||||
"\n%s" % traceback.format_exc())
|
"\n%s", traceback.format_exc())
|
||||||
return True # Suppress error if any
|
return True # Suppress error if any
|
||||||
|
|
||||||
|
|
||||||
@ -925,7 +925,7 @@ class BaseSharesTest(test.BaseTestCase):
|
|||||||
client.wait_for_resource_deletion(replica_id=res_id)
|
client.wait_for_resource_deletion(replica_id=res_id)
|
||||||
else:
|
else:
|
||||||
LOG.warning("Provided unsupported resource type for "
|
LOG.warning("Provided unsupported resource type for "
|
||||||
"cleanup '%s'. Skipping." % res["type"])
|
"cleanup '%s'. Skipping.", res["type"])
|
||||||
res["deleted"] = True
|
res["deleted"] = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -183,7 +183,7 @@ class SecurityServicesTest(base.BaseSharesTest,
|
|||||||
LOG.warning("Caught exception. It is expected in case backend "
|
LOG.warning("Caught exception. It is expected in case backend "
|
||||||
"fails having security-service with improper data "
|
"fails having security-service with improper data "
|
||||||
"that leads to share-server creation error. "
|
"that leads to share-server creation error. "
|
||||||
"%s" % six.text_type(e))
|
"%s", six.text_type(e))
|
||||||
|
|
||||||
update_data = {
|
update_data = {
|
||||||
"name": "name",
|
"name": "name",
|
||||||
|
@ -115,7 +115,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest):
|
|||||||
LOG.warning("Caught exception. It is expected in case backend "
|
LOG.warning("Caught exception. It is expected in case backend "
|
||||||
"fails having security-service with improper data "
|
"fails having security-service with improper data "
|
||||||
"that leads to share-server creation error. "
|
"that leads to share-server creation error. "
|
||||||
"%s" % six.text_type(e))
|
"%s", six.text_type(e))
|
||||||
|
|
||||||
self.assertRaises(lib_exc.Forbidden,
|
self.assertRaises(lib_exc.Forbidden,
|
||||||
self.cl.remove_sec_service_from_share_network,
|
self.cl.remove_sec_service_from_share_network,
|
||||||
|
@ -101,7 +101,7 @@ class SecurityServicesNegativeTest(base.BaseSharesTest):
|
|||||||
LOG.warning("Caught exception. It is expected in case backend "
|
LOG.warning("Caught exception. It is expected in case backend "
|
||||||
"fails having security-service with improper data "
|
"fails having security-service with improper data "
|
||||||
"that leads to share-server creation error. "
|
"that leads to share-server creation error. "
|
||||||
"%s" % six.text_type(e))
|
"%s", six.text_type(e))
|
||||||
|
|
||||||
self.assertRaises(lib_exc.Forbidden,
|
self.assertRaises(lib_exc.Forbidden,
|
||||||
self.shares_client.update_security_service,
|
self.shares_client.update_security_service,
|
||||||
|
@ -228,7 +228,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
|||||||
try:
|
try:
|
||||||
linux_client.validate_authentication()
|
linux_client.validate_authentication()
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception('Initializing SSH connection to %s failed' % ip)
|
LOG.exception('Initializing SSH connection to %s failed', ip)
|
||||||
self._log_console_output()
|
self._log_console_output()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
|
|||||||
first_address = net_addresses.values()[0][0]
|
first_address = net_addresses.values()[0][0]
|
||||||
ip = first_address['addr']
|
ip = first_address['addr']
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.debug("Instance: %s" % instance)
|
LOG.debug("Instance: %s", instance)
|
||||||
# In case on an error ip will be still none
|
# In case on an error ip will be still none
|
||||||
LOG.exception("Instance does not have a valid IP address."
|
LOG.exception("Instance does not have a valid IP address."
|
||||||
"Falling back to default")
|
"Falling back to default")
|
||||||
|
Loading…
Reference in New Issue
Block a user