diff --git a/config_tempest/api_discovery.py b/config_tempest/api_discovery.py index efe632df..3edb0e24 100644 --- a/config_tempest/api_discovery.py +++ b/config_tempest/api_discovery.py @@ -53,7 +53,7 @@ class Service(object): http = urllib3.PoolManager() r = http.request('GET', url, headers=self.headers) except Exception as e: - LOG.error("Request on service '%s' with url '%s' failed" % + LOG.error("Request on service '%s' with url '%s' failed", (self.name, url)) raise e if r.status >= 400: @@ -153,8 +153,8 @@ def get_identity_v3_extensions(keystone_v3_url): verify=False, headers={'Accept': 'application/json-home'}) except requests.exceptions.RequestException as re: - LOG.error("Request on service '%s' with url '%s' failed" % - ('identity', keystone_v3_url)) + LOG.error("Request on service '%s' with url '%s' failed", + 'identity', keystone_v3_url) raise re ext_h = 'http://docs.openstack.org/api/openstack-identity/3/ext/' res = [x for x in json.loads(r.content)['resources'].keys()] diff --git a/config_tempest/config_tempest.py b/config_tempest/config_tempest.py index 87086114..853c065c 100755 --- a/config_tempest/config_tempest.py +++ b/config_tempest/config_tempest.py @@ -176,7 +176,7 @@ def main(): configure_discovered_services(conf, services) configure_boto(conf, services) configure_horizon(conf) - LOG.info("Creating configuration file %s" % os.path.abspath(args.out)) + LOG.info("Creating configuration file %s", os.path.abspath(args.out)) with open(args.out, 'w') as f: conf.write(f) @@ -505,7 +505,7 @@ def give_role_to_user(tenants_client, roles_client, users_client, username, if not role_ids: if role_required: raise Exception("required role %s not found" % role_name) - LOG.debug("%s role not required" % role_name) + LOG.debug("%s role not required", role_name) return role_id = role_ids[0] try: @@ -809,7 +809,7 @@ def _download_file(url, destination): def _download_image(client, id, path): """Download file from glance.""" - LOG.info("Downloading image %s to %s" % (id, path)) + LOG.info("Downloading image %s to %s", (id, path)) body = client.show_image_file(id) LOG.debug(type(body.data)) with open(path, 'wb') as out: diff --git a/tox.ini b/tox.ini index 52cb3bbe..0b029dff 100644 --- a/tox.ini +++ b/tox.ini @@ -36,5 +36,6 @@ commands = oslo_debug_helper {posargs} show-source = True ignore = E123,E125 +enable-extensions = H106,H230,H904 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build