diff --git a/README.rst b/README.rst index e46362eb9..500af52e1 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,15 @@ Features * Discovery of volumes being attached to a host for many transport protocols. * Removal of volumes from a host. +Hacking +------- +Hacking on brick requires python-gdbm (for Debian derived distributions), +Python 2.7 and Python 3.4. A recent tox is required, as is a recent virtualenv +(13.1.0 or newer). + +If "tox -e py34" fails with the error "db type could not be determined", remove +the .testrepository/ directory and then run "tox -e py34". For any other imformation, refer to the parent project, Cinder: https://github.com/openstack/cinder diff --git a/os_brick/exception.py b/os_brick/exception.py index c4769af5e..dcc0c23f1 100644 --- a/os_brick/exception.py +++ b/os_brick/exception.py @@ -37,7 +37,6 @@ class BrickException(Exception): def __init__(self, message=None, **kwargs): self.kwargs = kwargs - self.kwargs['message'] = message if 'code' not in self.kwargs: try: @@ -45,11 +44,7 @@ class BrickException(Exception): except AttributeError: pass - for k, v in self.kwargs.items(): - if isinstance(v, Exception): - self.kwargs[k] = six.text_type(v) - - if self._should_format(): + if not message: try: message = self.message % kwargs @@ -73,9 +68,6 @@ class BrickException(Exception): def __unicode__(self): return six.text_type(self.msg) - def _should_format(self): - return self.kwargs['message'] is None or '%(message)' in self.message - class NotFound(BrickException): message = _("Resource could not be found.") diff --git a/tox.ini b/tox.ini index bd645da02..b3e4af0a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py27,py34,pep8 +envlist = py34,py27,pep8 skipsdist = True [testenv] @@ -28,19 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}' [testenv:docs] commands = python setup.py build_sphinx -[testenv:py34] -commands = - find . -type f -name "*.pyc" -delete - python -m testtools.run \ - os_brick.tests.test_brick \ - os_brick.tests.test_exception \ - os_brick.tests.test_utils \ - os_brick.tests.initiator.test_connector \ - os_brick.tests.initiator.test_linuxfc \ - os_brick.tests.initiator.test_linuxrbd \ - os_brick.tests.initiator.test_linuxscsi - - [flake8] # H803 skipped on purpose per list discussion. # E123, E125 skipped as they are invalid PEP-8.