Unpin flake8 and fix lint

Change-Id: Iacae0fc791003d7f1730363f10f509434b0e671f
This commit is contained in:
Frode Nordahl 2020-03-10 10:50:27 +01:00
parent dc2f5e5259
commit 3765c0b123
No known key found for this signature in database
GPG Key ID: 6A5D59A3BA48373F
8 changed files with 12 additions and 7 deletions

View File

@ -26,6 +26,7 @@ def _add_path(path):
if path not in sys.path:
sys.path.insert(1, path)
_add_path(_hooks)
_add_path(_root)

View File

@ -26,6 +26,7 @@ def _add_path(path):
if path not in sys.path:
sys.path.insert(1, path)
_add_path(_hooks)
_add_path(_root)
@ -56,5 +57,6 @@ def openstack_upgrade():
os.execl('./hooks/config-changed-postupgrade',
'config-changed-postupgrade')
if __name__ == '__main__':
openstack_upgrade()

View File

@ -175,5 +175,6 @@ def main():
[config['config_path'], config['config_file']])
return audits.action_parse_results(audits.run(config))
if __name__ == "__main__":
sys.exit(main())

View File

@ -881,7 +881,7 @@ def get_admin_token():
if l.split(' ')[0] == 'admin_token':
try:
return l.split('=')[1].strip()
except:
except Exception:
error_out('Could not parse admin_token line from %s' %
KEYSTONE_CONF)
error_out('Could not find admin_token line in %s' % KEYSTONE_CONF)
@ -2195,7 +2195,7 @@ def check_extra_for_assess_status(configs):
if relation_ids('ha'):
try:
get_hacluster_config()
except:
except Exception:
return ('blocked',
'hacluster missing configuration: '
'vip, vip_iface, vip_cidr')

View File

@ -10,7 +10,7 @@
charm-tools>=2.4.4
requests>=2.18.4
mock>=1.2
flake8>=2.2.4,<=2.4.1
flake8>=2.2.4
stestr>=2.2.0
coverage>=4.5.2
pyudev # for ceph-* charm unit tests (need to fix the ceph-* charm unit tests/mocking)

View File

@ -111,5 +111,5 @@ commands =
functest-run-suite --keep-model --bundle {posargs}
[flake8]
ignore = E402,E226
ignore = E402,E226,W504
exclude = */charmhelpers

View File

@ -27,6 +27,7 @@ def _add_path(path):
if path not in sys.path:
sys.path.insert(1, path)
_add_path(_actions)
_add_path(_hooks)
_add_path(_charmhelpers)

View File

@ -20,9 +20,9 @@ from test_utils import CharmTestCase
with patch('charmhelpers.contrib.openstack.utils.'
'snap_install_requested') as snap_install_requested, \
patch('keystone_utils.register_configs') as configs:
snap_install_requested.return_value = False
configs.return_value = 'test-config'
import actions.actions
snap_install_requested.return_value = False
configs.return_value = 'test-config'
import actions.actions
class PauseTestCase(CharmTestCase):