From fa6a29379c8cc87d8b495cc0a1d54cb844cc601a Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Wed, 13 May 2020 13:23:41 +0530 Subject: [PATCH] Fix some pep8 errors - F632 - E305 - E117 Change-Id: Id08a49c401a11a6f43ff132e798bdb1088ddb75d --- tripleoclient/heat_launcher.py | 2 +- .../test_overcloud_netenv_validate.py | 18 +++++++++--------- tripleoclient/v1/undercloud_config.py | 1 + tripleoclient/v1/undercloud_preflight.py | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tripleoclient/heat_launcher.py b/tripleoclient/heat_launcher.py index 3ee5be0d6..e6e236652 100644 --- a/tripleoclient/heat_launcher.py +++ b/tripleoclient/heat_launcher.py @@ -280,7 +280,7 @@ class HeatContainerLauncher(HeatBaseLauncher): # 137 means the container was killed by 'kill -9' which happens # then we're done creating the Heat stack, so we consider it # as successful. - if e.returncode is not 137: + if e.returncode != 137: raise Exception('heat_all container did not run as expected.') def heat_db_sync(self): diff --git a/tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py b/tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py index 52fc584f1..bb234ecb1 100644 --- a/tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py +++ b/tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py @@ -263,14 +263,14 @@ class TestValidateOvercloudNetenv(fakes.TestValidateOvercloudNetenv): def test_command(self, mock_nic_validate): """Testing the command with a minimal file that will fail""" with tempfile.NamedTemporaryFile('wt') as net_file: - net_file.write(EMPTY_NETENV) - net_file.flush() + net_file.write(EMPTY_NETENV) + net_file.flush() - arglist = ['--file', net_file.name] - verifylist = [ - ('netenv', net_file.name), - ] + arglist = ['--file', net_file.name] + verifylist = [ + ('netenv', net_file.name), + ] - parsed_args = self.check_parser(self.cmd, arglist, verifylist) - # Validating a minimal file shouldn't raise errors. - self.cmd.take_action(parsed_args) + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + # Validating a minimal file shouldn't raise errors. + self.cmd.take_action(parsed_args) diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 255fef763..3a46f7177 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -112,6 +112,7 @@ def _load_subnets_config_groups(): else: CONF.register_opts(config.get_remote_subnet_opts(), group=g) + LOG = logging.getLogger(__name__ + ".undercloud_config") diff --git a/tripleoclient/v1/undercloud_preflight.py b/tripleoclient/v1/undercloud_preflight.py index 5b44c2fd1..e954456b1 100644 --- a/tripleoclient/v1/undercloud_preflight.py +++ b/tripleoclient/v1/undercloud_preflight.py @@ -34,6 +34,7 @@ from tripleoclient import utils class FailedValidation(Exception): pass + CONF = cfg.CONF # We need 8 GB, leave a little room for variation in what 8 GB means on