From 64ec1486b1e67e5a30784864d8495524b3eebdad Mon Sep 17 00:00:00 2001 From: Patrick Bonnell Date: Wed, 12 Sep 2018 12:09:23 -0400 Subject: [PATCH] Fix flake8 errors in sysinv Story: 2003087 Task: 23171 Change-Id: I297f686875afb66ff7c0c44be6da8a6a6ebba29d Signed-off-by: Patrick Bonnell --- .zuul.yaml | 4 ++-- sysinv/sysinv/sysinv/sysinv/agent/lldp.py | 3 --- sysinv/sysinv/sysinv/sysinv/agent/manager.py | 1 - sysinv/sysinv/sysinv/sysinv/api/controllers/v1/__init__.py | 1 - sysinv/sysinv/sysinv/sysinv/api/controllers/v1/helm_charts.py | 3 +-- .../migrate_repo/versions/071_storage_ceph_external.py | 2 +- .../sysinv/db/sqlalchemy/migrate_repo/versions/075_ptp.py | 1 + sysinv/sysinv/sysinv/sysinv/puppet/puppet.py | 1 - 8 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index dd7e378b1a..0583bdea22 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,8 +4,7 @@ jobs: - openstack-tox-linters - sysinv-tox-py27 - - sysinv-tox-flake8: - voting: false + - sysinv-tox-flake8 - controllerconfig-tox-flake8 - controllerconfig-tox-py27 - controllerconfig-tox-pylint @@ -14,6 +13,7 @@ jobs: - openstack-tox-linters - sysinv-tox-py27 + - sysinv-tox-flake8 - controllerconfig-tox-flake8 - controllerconfig-tox-py27 - controllerconfig-tox-pylint diff --git a/sysinv/sysinv/sysinv/sysinv/agent/lldp.py b/sysinv/sysinv/sysinv/sysinv/agent/lldp.py index 51d1137b13..1aeb4c3197 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/lldp.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/lldp.py @@ -543,7 +543,6 @@ class LLDPOperator(object): LOG.error("vswitch_lldp_agent_list is not implemented.") return [] - def vswitch_lldp_neighbour_list(self): """Sends a request to the vswitch requesting the full list of LLDP @@ -553,7 +552,6 @@ class LLDPOperator(object): LOG.error("vswitch_lldp_neighbour_ist s not implemented.") return [] - def lldp_agents_list(self, do_compute=False): self.agent_audit_count += 1 if self.agent_audit_count > constants.LLDP_FULL_AUDIT_COUNT: @@ -660,5 +658,4 @@ class LLDPOperator(object): newname], stdout=subprocess.PIPE) if do_compute: - attrs = {"system-name": newname} LOG.error("lldp_update_systemname failed due to lack of vswitch") diff --git a/sysinv/sysinv/sysinv/sysinv/agent/manager.py b/sysinv/sysinv/sysinv/sysinv/agent/manager.py index 3869685d5b..01e2462efc 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/manager.py @@ -1552,7 +1552,6 @@ class AgentManager(service.PeriodicService): :returns: none """ try: - from controllerconfig import backup_restore from controllerconfig.upgrades import \ management as upgrades_management except ImportError: diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/__init__.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/__init__.py index 49117bfff7..d12ca7e009 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/__init__.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/__init__.py @@ -515,7 +515,6 @@ class V1(base.APIBase): bookmark=True) ] - v1.iinfra = [link.Link.make_link('self', pecan.request.host_url, 'iinfra', ''), link.Link.make_link('bookmark', diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/helm_charts.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/helm_charts.py index a9c0239dd9..3dd4a8f6ad 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/helm_charts.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/helm_charts.py @@ -80,7 +80,7 @@ class HelmChartsController(rest.RestController): # Extract the info we want. values = output.split('USER-SUPPLIED VALUES:\n')[1].split( '\nCOMPUTED VALUES:')[0] - except: + except Exception: raise finally: os.remove(chartfile) @@ -91,7 +91,6 @@ class HelmChartsController(rest.RestController): return values - @wsme_pecan.wsexpose(wtypes.text) def get_all(self): """Provides information about the available charts to override.""" diff --git a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/071_storage_ceph_external.py b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/071_storage_ceph_external.py index 2a3f2d415b..8819aee7c9 100644 --- a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/071_storage_ceph_external.py +++ b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/071_storage_ceph_external.py @@ -24,7 +24,7 @@ def upgrade(migrate_engine): meta = MetaData() meta.bind = migrate_engine - storage_backend = Table('storage_backend', meta, autoload=True) + Table('storage_backend', meta, autoload=True) # Define and create the storage_external table. storage_external = Table( diff --git a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/075_ptp.py b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/075_ptp.py index 3e8618f9be..00435f8978 100644 --- a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/075_ptp.py +++ b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/migrate_repo/versions/075_ptp.py @@ -15,6 +15,7 @@ from sqlalchemy import Column, MetaData, Table, ForeignKey ENGINE = 'InnoDB' CHARSET = 'utf8' + def _populate_ptp_table(migrate_engine, meta, ptp, i_system): """This function inserts all the initial data about journals, into the ptp table. diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/puppet.py b/sysinv/sysinv/sysinv/sysinv/puppet/puppet.py index 1b890ab613..4d47c82f7d 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/puppet.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/puppet.py @@ -13,7 +13,6 @@ import os import tempfile import yaml -from oslo_utils import importutils from stevedore import extension from sysinv.openstack.common import log as logging