diff --git a/tox.ini b/tox.ini index bcee22487..e8462afff 100644 --- a/tox.ini +++ b/tox.ini @@ -42,10 +42,8 @@ commands = --output-file etc/watcher/watcher.conf.sample [flake8] -# E123, E125 skipped as they are invalid PEP-8. - show-source=True -ignore=E123,E125 +ignore= builtins= _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/ diff --git a/watcher/api/middleware/parsable_error.py b/watcher/api/middleware/parsable_error.py index 57ba5cb9e..0737e48ab 100644 --- a/watcher/api/middleware/parsable_error.py +++ b/watcher/api/middleware/parsable_error.py @@ -69,8 +69,7 @@ class ParsableErrorMiddleware(object): if (state['status_code'] // 100) not in (2, 3): req = webob.Request(environ) if (req.accept.best_match(['application/json', 'application/xml'] - ) == 'application/xml' - ): + ) == 'application/xml'): try: # simple check xml is valid body = [et.ElementTree.tostring( diff --git a/watcher/decision_engine/strategy/strategies/outlet_temp_control.py b/watcher/decision_engine/strategy/strategies/outlet_temp_control.py index c8d62825d..c93bea25b 100644 --- a/watcher/decision_engine/strategy/strategies/outlet_temp_control.py +++ b/watcher/decision_engine/strategy/strategies/outlet_temp_control.py @@ -180,9 +180,9 @@ class OutletTempControl(BaseStrategy): cores_available = cap_cores.get_capacity(host) - cores_used disk_available = cap_disk.get_capacity(host) - mem_used mem_available = cap_mem.get_capacity(host) - disk_used - if cores_available >= required_cores and \ - disk_available >= required_disk and \ - mem_available >= required_mem: + if cores_available >= required_cores \ + and disk_available >= required_disk \ + and mem_available >= required_mem: dest_servers.append(hvmap) return dest_servers