Skip to content

Commit

Permalink
Release 21.3: Improve ionice integration (support busybox)
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Nov 17, 2018
1 parent 9388878 commit d09a536
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -11,6 +11,22 @@ to `semantic versioning`_.
.. _Keep a Changelog: http://keepachangelog.com/
.. _semantic versioning: http://semver.org/

`Release 21.3`_ (2018-11-17)
----------------------------

Merged pull request `#16`_ that changes the ``ionice`` integration to accept
the strings '1', '2' and '3' in addition to 'idle', 'best-effort' and
'realtime' because ``busybox`` doesn't support the verbose strings.

It's still up to the caller to pick the right kind of value and I'm a bit
conflicted about that because it's creating a leaky abstraction. I may at a
later point decide to add automatic translation from the verbose labels to the
numeric codes (which seem to be the lowest common denominator that's always
supported) ...

.. _Release 21.3: https://github.com/xolox/python-executor/compare/21.2...21.3
.. _#16: https://github.com/xolox/python-executor/pull/16

`Release 21.2`_ (2018-10-11)
----------------------------

Expand Down
11 changes: 9 additions & 2 deletions executor/__init__.py
Expand Up @@ -3,7 +3,7 @@
# Programmer friendly subprocess wrapper.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 30, 2018
# Last Change: November 17, 2018
# URL: https://executor.readthedocs.io

"""
Expand Down Expand Up @@ -68,7 +68,7 @@
from executor.process import ControllableProcess

# Semi-standard module versioning.
__version__ = '21.2'
__version__ = '21.3'

# Initialize a logger.
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -2116,6 +2116,13 @@ def validate_ionice_class(value):
'best-effort', or 'realtime').
:raises: :exc:`~exceptions.ValueError` when the given value isn't one of
the strings mentioned above.
The strings 'idle', 'best-effort' and 'realtime' are preferred for
readability but not supported in minimalistic environments like busybox
which only support the values '1', '2' and '3' (refer to `#16`_). It's up
to the caller to choose the correct value, no translation is done.
.. _#16: https://github.com/xolox/python-executor/pull/16
"""
expected = ('idle', 'best-effort', 'realtime', '1', '2', '3')
if value not in expected:
Expand Down

0 comments on commit d09a536

Please sign in to comment.