From c3b0cbabba38d9f3ccdc30831a0e93b202d8c40f Mon Sep 17 00:00:00 2001 From: "Simental Magana, Marcos" Date: Thu, 4 Feb 2016 11:16:19 -0600 Subject: [PATCH 1/3] Fix W503 flake8 issue. W503 line break before binary operator Signed-off-by: Simental Magana, Marcos --- clearstack/common/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clearstack/common/util.py b/clearstack/common/util.py index ee89954..4efb915 100644 --- a/clearstack/common/util.py +++ b/clearstack/common/util.py @@ -226,8 +226,9 @@ def find_my_ip_from_config(config_ips): def is_localhost(host): - return (host == "localhost" or host == socket.gethostname() - or host in get_ips()) + return (host == "localhost" or + host == socket.gethostname() or + host in get_ips()) def has_localhost(hosts): From 56d5ce117089faf11b77e2a650279772a8456dbf Mon Sep 17 00:00:00 2001 From: "Simental Magana, Marcos" Date: Thu, 4 Feb 2016 11:36:06 -0600 Subject: [PATCH 2/3] Fix broken debug messages Signed-off-by: Simental Magana, Marcos --- clearstack/modules/neutron.py | 4 ++-- clearstack/modules/swift.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clearstack/modules/neutron.py b/clearstack/modules/neutron.py index 592e6d7..024f47a 100644 --- a/clearstack/modules/neutron.py +++ b/clearstack/modules/neutron.py @@ -234,11 +234,11 @@ class Neutron(OpenStackService): def create_router(self, router, gw, interfaces): try: - LOG.debug("checking if router '{0}' exists".format(name)) + LOG.debug("checking if router '{0}' exists".format(router)) util.run_command("neutron router-show %s" % router, environ=self._env) except: - LOG.debug("creating router '{0}'".format(name)) + LOG.debug("creating router '{0}'".format(router)) util.run_command("neutron router-create %s" % router, environ=self._env) util.run_command("neutron router-gateway-set %s %s" diff --git a/clearstack/modules/swift.py b/clearstack/modules/swift.py index d905938..fc98ce3 100644 --- a/clearstack/modules/swift.py +++ b/clearstack/modules/swift.py @@ -88,7 +88,7 @@ class Swift(OpenStackService): with open(name, 'wb') as f: f.seek(1024 * 1024 * 1024 * size - 1) f.write(b"\0") - LOG.("formatting '{0}' as XFS".format(name)) + LOG.debug("formatting '{0}' as XFS".format(name)) util.run_command("mkfs.xfs %s" % name) devs = CONF['CONFIG_SWIFT_STORAGES'] From 59a794f6979230cfffc24f9d5d14acb62ac08419 Mon Sep 17 00:00:00 2001 From: "Simental Magana, Marcos" Date: Thu, 4 Feb 2016 11:36:56 -0600 Subject: [PATCH 3/3] Fix pep8 error (line too long) Signed-off-by: Simental Magana, Marcos --- clearstack/modules/rabbitmq.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clearstack/modules/rabbitmq.py b/clearstack/modules/rabbitmq.py index 30bcf0c..ee2a808 100644 --- a/clearstack/modules/rabbitmq.py +++ b/clearstack/modules/rabbitmq.py @@ -69,6 +69,7 @@ class Rabbitmq: .format(user)) def set_permissions(self, auth_user, permissions): - LOG.debug("setting rabbitmq permissions for user '{0}'".format(auth_user)) + LOG.debug("setting rabbitmq permissions for " + "user '{0}'".format(auth_user)) util.run_command("rabbitmqctl set_permissions {0} {1}" .format(auth_user, permissions))