diff --git a/HACKING.rst b/HACKING.rst index 1cee4956..4a039312 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ oslo.service Style Commandments -====================================================== +=============================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ diff --git a/oslo_service/periodic_task.py b/oslo_service/periodic_task.py index caa99e40..ea3a9e14 100644 --- a/oslo_service/periodic_task.py +++ b/oslo_service/periodic_task.py @@ -14,20 +14,18 @@ import copy import logging import random +import six import time +from oslo_service._i18n import _ +from oslo_service import _options +from oslo_utils import reflection + if hasattr(time, 'monotonic'): now = time.monotonic else: from monotonic import monotonic as now # noqa -from oslo_utils import reflection -import six - -from oslo_service._i18n import _ -from oslo_service import _options - - LOG = logging.getLogger(__name__) DEFAULT_INTERVAL = 60.0 diff --git a/oslo_service/service.py b/oslo_service/service.py index 133a6a2b..2924b1ee 100644 --- a/oslo_service/service.py +++ b/oslo_service/service.py @@ -139,8 +139,8 @@ class SignalHandler(object): self._ignore_signals = ('SIG_DFL', 'SIG_IGN') self._signals_by_name = dict((name, getattr(signal, name)) for name in dir(signal) - if name.startswith("SIG") - and name not in self._ignore_signals) + if name.startswith("SIG") and + name not in self._ignore_signals) self.signals_to_name = dict( (sigval, name) for (name, sigval) in self._signals_by_name.items()) diff --git a/test-requirements.txt b/test-requirements.txt index eeedfefe..f52f1860 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. fixtures>=3.0.0 # Apache-2.0/BSD -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 requests>=2.14.2 # Apache-2.0 diff --git a/tox.ini b/tox.ini index a111533b..abbb0799 100644 --- a/tox.ini +++ b/tox.ini @@ -38,9 +38,10 @@ commands = python setup.py test --coverage --coverage-package-name=oslo_service [flake8] # E123, E125 skipped as they are invalid PEP-8. +# E731 skipped as assign a lambda expression show-source = True -ignore = E123,E125 +ignore = E123,E125,E731 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build [hacking]