summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-09-05 18:08:10 +0000
committerGerrit Code Review <review@openstack.org>2012-09-05 18:08:10 +0000
commit800a8704bdde852a6646c970db7433a594c52891 (patch)
treefc009068827ce64fafc649fd2d1d57b96dd7b3e0 /nova/openstack
parent6c6e6a8f48471c2feb6b120a0b14d313a3ee25bb (diff)
parentc17f8ed74d5b4d9ae02f506c66d5bd38c4334b16 (diff)
downloadnova-800a8704bdde852a6646c970db7433a594c52891.tar.gz
nova-800a8704bdde852a6646c970db7433a594c52891.tar.xz
nova-800a8704bdde852a6646c970db7433a594c52891.zip
Merge "Sync some updates from openstack-common"
Diffstat (limited to 'nova/openstack')
-rw-r--r--nova/openstack/common/excutils.py4
-rw-r--r--nova/openstack/common/importutils.py2
-rw-r--r--nova/openstack/common/policy.py2
-rw-r--r--nova/openstack/common/timeutils.py4
4 files changed, 6 insertions, 6 deletions
diff --git a/nova/openstack/common/excutils.py b/nova/openstack/common/excutils.py
index 67c9fa951..5dd483017 100644
--- a/nova/openstack/common/excutils.py
+++ b/nova/openstack/common/excutils.py
@@ -30,14 +30,14 @@ def save_and_reraise_exception():
"""Save current exception, run some code and then re-raise.
In some cases the exception context can be cleared, resulting in None
- being attempted to be reraised after an exception handler is run. This
+ being attempted to be re-raised after an exception handler is run. This
can happen when eventlet switches greenthreads or when running an
exception handler, code raises and catches an exception. In both
cases the exception context will be cleared.
To work around this, we save the exception state, run handler code, and
then re-raise the original exception. If another exception occurs, the
- saved exception is logged and the new exception is reraised.
+ saved exception is logged and the new exception is re-raised.
"""
type_, value, tb = sys.exc_info()
try:
diff --git a/nova/openstack/common/importutils.py b/nova/openstack/common/importutils.py
index 2fbb0291a..f45372b4d 100644
--- a/nova/openstack/common/importutils.py
+++ b/nova/openstack/common/importutils.py
@@ -29,7 +29,7 @@ def import_class(import_str):
try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
- except (ImportError, ValueError, AttributeError), exc:
+ except (ValueError, AttributeError), exc:
raise ImportError('Class %s cannot be found (%s)' %
(class_str,
traceback.format_exception(*sys.exc_info())))
diff --git a/nova/openstack/common/policy.py b/nova/openstack/common/policy.py
index 571830a07..4b3b2c856 100644
--- a/nova/openstack/common/policy.py
+++ b/nova/openstack/common/policy.py
@@ -296,5 +296,5 @@ def _check_generic(brain, match_kind, match, target_dict, cred_dict):
# TODO(termie): do dict inspection via dot syntax
match = match % target_dict
if match_kind in cred_dict:
- return match == cred_dict[match_kind]
+ return match == unicode(cred_dict[match_kind])
return False
diff --git a/nova/openstack/common/timeutils.py b/nova/openstack/common/timeutils.py
index ae300e456..c4f6cf049 100644
--- a/nova/openstack/common/timeutils.py
+++ b/nova/openstack/common/timeutils.py
@@ -93,13 +93,13 @@ def set_time_override(override_time=datetime.datetime.utcnow()):
def advance_time_delta(timedelta):
- """Advance overriden time using a datetime.timedelta."""
+ """Advance overridden time using a datetime.timedelta."""
assert(not utcnow.override_time is None)
utcnow.override_time += timedelta
def advance_time_seconds(seconds):
- """Advance overriden time by seconds."""
+ """Advance overridden time by seconds."""
advance_time_delta(datetime.timedelta(0, seconds))