Unpin flake8, fix lint

Change-Id: Iab73f1127bfbdf11626727f3044366d2e5745439
This commit is contained in:
Frode Nordahl 2020-08-03 12:37:54 +02:00
parent e3f9894aea
commit c0113217bf
8 changed files with 12 additions and 10 deletions

View File

@ -41,5 +41,6 @@ def create_crush_rule():
except subprocess.CalledProcessError as e:
hookenv.action_fail(str(e))
if __name__ == '__main__':
create_crush_rule()

View File

@ -63,7 +63,7 @@ def make_erasure_profile():
action_fail("Create erasure profile failed with "
"message: {}".format(str(e)))
elif plugin == "lrc":
l = action_get("locality-chunks")
locality_chunks = action_get("locality-chunks")
crush_locality = action_get('crush-locality')
try:
create_erasure_profile(service='admin',
@ -71,7 +71,7 @@ def make_erasure_profile():
profile_name=name,
data_chunks=k,
coding_chunks=m,
locality=l,
locality=locality_chunks,
crush_locality=crush_locality,
failure_domain=failure_domain,
device_class=device_class)

View File

@ -42,5 +42,6 @@ def main():
}
return audits.action_parse_results(audits.run(config))
if __name__ == "__main__":
sys.exit(main())

View File

@ -291,7 +291,7 @@ def main(args):
EXIT_CODES = {'ok': 0, 'warning': 1, 'critical': 2, 'unknown': 3}
exitcode = 'ok'
try:
msg = check_ceph_status(args)
check_ceph_status(args)
except UnknownError as msg:
print(msg)
exitcode = 'unknown'
@ -301,7 +301,7 @@ def main(args):
except WarnError as msg:
print(msg)
exitcode = 'warning'
except:
except Exception:
print("%s raised unknown exception '%s'" % ('check_ceph_status',
sys.exc_info()[0]))
print('=' * 60)

View File

@ -293,9 +293,9 @@ def config_changed():
# unconditionally verify that the fsid and monitor-secret are set now
# otherwise we exit until a leader does this.
if leader_get('fsid') is None or leader_get('monitor-secret') is None:
log('still waiting for leader to setup keys')
status_set('waiting', 'Waiting for leader to setup keys')
return
log('still waiting for leader to setup keys')
status_set('waiting', 'Waiting for leader to setup keys')
return
emit_cephconf()

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

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

View File

@ -15,7 +15,7 @@
import json
import unittest
from mock import (
from unittest.mock import (
call,
patch,
)