diff --git a/anvil/components/base_runtime.py b/anvil/components/base_runtime.py index 79440b30..1b0577db 100644 --- a/anvil/components/base_runtime.py +++ b/anvil/components/base_runtime.py @@ -185,7 +185,7 @@ class ServiceRuntime(ProgramRuntime): sh.execute(start_cmd, shell=True) except excp.ProcessExecutionError: LOG.error("Failed to start program %s under component %s.", - colorizer.quote(program), self.name) + colorizer.quote(program), self.name) return False return True @@ -205,7 +205,7 @@ class ServiceRuntime(ProgramRuntime): sh.execute(stop_cmd, shell=True) except excp.ProcessExecutionError: LOG.error("Failed to stop program %s under component %s.", - colorizer.quote(program), self.name) + colorizer.quote(program), self.name) return False return True diff --git a/anvil/components/helpers/glance.py b/anvil/components/helpers/glance.py index 02dc5935..ebf99ca8 100644 --- a/anvil/components/helpers/glance.py +++ b/anvil/components/helpers/glance.py @@ -111,8 +111,13 @@ class Unpacker(object): kernel_fn = None ramdisk_fn = None img_fn = None - utils.log_iterable(files, logger=LOG, - header="Looking at %s files from %s to find the kernel/ramdisk/root images" % (len(files), colorizer.quote(files_location))) + utils.log_iterable( + files, + logger=LOG, + header="Looking at %s files from %s to find the " + "kernel/ramdisk/root images" % + (len(files), colorizer.quote(files_location)) + ) for fn in files: if self._pat_checker(fn, KERNEL_CHECKS): diff --git a/anvil/components/helpers/keystone.py b/anvil/components/helpers/keystone.py index bf8d727b..701ae40f 100644 --- a/anvil/components/helpers/keystone.py +++ b/anvil/components/helpers/keystone.py @@ -26,8 +26,10 @@ class Initializer(object): def __init__(self, service_token, admin_uri): # Late load since its using a client lib that is only avail after install... - self.client = importer.construct_entry_point("keystoneclient.v2_0.client:Client", - token=service_token, endpoint=admin_uri) + self.client = importer.construct_entry_point( + "keystoneclient.v2_0.client:Client", + token=service_token, endpoint=admin_uri + ) def _create_tenants(self, tenants): tenants_made = dict() @@ -188,8 +190,8 @@ def get_shared_params(ip, service_token, admin_password, service_password, 'host': keystone_auth_host, }, 'admin_templated': { - 'uri': utils.make_url(keystone_auth_proto, - keystone_auth_host, port='$(admin_port)s', path="v2.0"), + 'uri': utils.make_url(keystone_auth_proto, keystone_auth_host, + port='$(admin_port)s', path="v2.0"), 'protocol': keystone_auth_proto, 'host': keystone_auth_host, }, @@ -201,7 +203,8 @@ def get_shared_params(ip, service_token, admin_password, service_password, }, 'public_templated': { 'uri': utils.make_url(keystone_service_proto, - keystone_service_host, port='$(public_port)s', path="v2.0"), + keystone_service_host, + port='$(public_port)s', path="v2.0"), 'protocol': keystone_service_proto, 'host': keystone_service_host, }, diff --git a/anvil/components/helpers/virt.py b/anvil/components/helpers/virt.py index 86000d50..1a28b474 100644 --- a/anvil/components/helpers/virt.py +++ b/anvil/components/helpers/virt.py @@ -142,8 +142,9 @@ class Virsh(object): if domain.startswith(inst_prefix): kill_domains.append(domain) if kill_domains: - utils.log_iterable(kill_domains, logger=LOG, - header="Found %s old domains to destroy" % (len(kill_domains))) + header = ("Found %s old domains to destroy" % + len(kill_domains)) + utils.log_iterable(kill_domains, logger=LOG, header=header) for domain in sorted(kill_domains): self._destroy_domain(libvirt, ch, domain) except libvirt.libvirtError as e: diff --git a/anvil/components/rabbit.py b/anvil/components/rabbit.py index 5303ae01..a5332fd6 100644 --- a/anvil/components/rabbit.py +++ b/anvil/components/rabbit.py @@ -112,10 +112,10 @@ class RabbitRuntime(bruntime.ProgramRuntime): st = bruntime.STATUS_STARTED return [ bruntime.ProgramStatus(status=st, - details={ - 'STDOUT': sysout, - 'STDERR': stderr, - }), + details={ + 'STDOUT': sysout, + 'STDERR': stderr + }) ] def _run_action(self, action, check_exit_code=True): diff --git a/anvil/packaging/yum.py b/anvil/packaging/yum.py index d34759a9..b02277d1 100644 --- a/anvil/packaging/yum.py +++ b/anvil/packaging/yum.py @@ -194,7 +194,7 @@ class YumDependencyHandler(base.DependencyHandler): continue utils.log_iterable(src_repo_files, header=('Building %s RPM packages from their' - ' SRPMs for repo %s using %s jobs') % + ' SRPMs for repo %s using %s jobs') % (len(src_repo_files), self.SRC_REPOS[repo_name], self._jobs), logger=LOG) rpmbuild_flags = "--rebuild" diff --git a/tools/yaml-pretty.py b/tools/yaml-pretty.py index a7adb541..cbd61d84 100755 --- a/tools/yaml-pretty.py +++ b/tools/yaml-pretty.py @@ -14,11 +14,10 @@ if __name__ == "__main__": data = yaml.load(fh.read()) fh.close() formatted = yaml.dump(data, - line_break="\n", - indent=4, - explicit_start=True, - explicit_end=True, - default_flow_style=False, - ) + line_break="\n", + indent=4, + explicit_start=True, + explicit_end=True, + default_flow_style=False) print("# Formatted %s" % (fn)) print(formatted) diff --git a/tox.ini b/tox.ini index 97273794..6a6572f8 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' commands = {posargs} [flake8] -ignore = H102,H302,H402,H403,E123,E124,E125,E126,E127,E128,E501 +ignore = H102,H302,H402,H403,E123,E124,E125,E126,E127,E501 builtins = _ exclude = .venv,.tox,dist,doc,*egg,.git,build