From 29ac0fcaaeae7b36b99b6aa89ae737f487b7b1e1 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 3 Apr 2015 14:08:13 +0000 Subject: [PATCH] Update to the latest version of hacking Update the version of hacking to the one released for kilo, and fix issues with code formatting that cause the new hacking checks to fail. Change-Id: I4c9906df3e71f33b5a13e1f68584d445d79daceb --- oslo_versionedobjects/__init__.py | 13 ------------- oslo_versionedobjects/base.py | 5 ++++- oslo_versionedobjects/exception.py | 4 +++- oslo_versionedobjects/tests/test_objects.py | 4 +++- test-requirements.txt | 2 +- tox.ini | 2 +- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/oslo_versionedobjects/__init__.py b/oslo_versionedobjects/__init__.py index 67f4db51..e69de29b 100644 --- a/oslo_versionedobjects/__init__.py +++ b/oslo_versionedobjects/__init__.py @@ -1,13 +0,0 @@ -# Copyright 2013 IBM Corp. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. diff --git a/oslo_versionedobjects/base.py b/oslo_versionedobjects/base.py index 63d7bc6f..e9392b6f 100644 --- a/oslo_versionedobjects/base.py +++ b/oslo_versionedobjects/base.py @@ -295,7 +295,9 @@ class VersionedObject(object): @classmethod def obj_name(cls): - """Return a canonical name for this object which will be used over + """Return the object's name + + Return a canonical name for this object which will be used over the wire for remote hydration. """ return cls.__name__ @@ -812,6 +814,7 @@ class VersionedObjectSerializer(messaging.NoOpSerializer): def _process_iterable(self, context, action_fn, values): """Process an iterable, taking an action on each value. + :param:context: Request context :param:action_fn: Action to take on each item in values :param:values: Iterable container of things to take action on diff --git a/oslo_versionedobjects/exception.py b/oslo_versionedobjects/exception.py index b9c292a7..05406d6d 100644 --- a/oslo_versionedobjects/exception.py +++ b/oslo_versionedobjects/exception.py @@ -59,7 +59,9 @@ def _cleanse_dict(original): def wrap_exception(notifier=None, get_notifier=None): - """This decorator wraps a method to catch any exceptions that may + """Catch all exceptions in wrapped method + + This decorator wraps a method to catch any exceptions that may get thrown. It also optionally sends the exception to the notification system. """ diff --git a/oslo_versionedobjects/tests/test_objects.py b/oslo_versionedobjects/tests/test_objects.py index d8031f09..6a54c3bb 100755 --- a/oslo_versionedobjects/tests/test_objects.py +++ b/oslo_versionedobjects/tests/test_objects.py @@ -347,7 +347,9 @@ class _BaseTestCase(test.TestCase): self.assertEqual(expected, jsonutils.dumps(obj_val)) def str_comparator(self, expected, obj_val): - """Compare an object field to a string in the db by performing + """Compare a field to a string value + + Compare an object field to a string in the db by performing a simple coercion on the object field value. """ self.assertEqual(expected, str(obj_val)) diff --git a/test-requirements.txt b/test-requirements.txt index a8d0e615..b2307750 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=0.5.6,<0.8 +hacking>=0.10.0,<0.11 oslotest>=1.5.1,<1.6.0 # Apache-2.0 testtools>=0.9.36,!=1.2.0 # These are needed for docs generation diff --git a/tox.ini b/tox.ini index fb0b798a..c1a7d6de 100644 --- a/tox.ini +++ b/tox.ini @@ -41,4 +41,4 @@ builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build [hacking] -import_exceptions = +import_exceptions = oslo_versionedobjects._i18n