diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-09-05 11:24:50 +0100 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2012-09-05 11:24:50 +0100 |
| commit | c17f8ed74d5b4d9ae02f506c66d5bd38c4334b16 (patch) | |
| tree | 22ae7b62b712a206e34425c08c78e9aceaed2887 /nova/openstack | |
| parent | 84c62b35ff349ff0301eed36f765031d400e6c24 (diff) | |
| download | nova-c17f8ed74d5b4d9ae02f506c66d5bd38c4334b16.tar.gz nova-c17f8ed74d5b4d9ae02f506c66d5bd38c4334b16.tar.xz nova-c17f8ed74d5b4d9ae02f506c66d5bd38c4334b16.zip | |
Sync some updates from openstack-common
Syncs the latest code from the stable/folsom branch.
Includes:
5a56539 Allow non-string items in the creds dict.
769ec65 Don't trap then re-raise ImportError.
202b8b7 Fix spelling typos
Change-Id: I6473358c743ce77b90dfb1282f3e257e6fd3dbf6
Diffstat (limited to 'nova/openstack')
| -rw-r--r-- | nova/openstack/common/excutils.py | 4 | ||||
| -rw-r--r-- | nova/openstack/common/importutils.py | 2 | ||||
| -rw-r--r-- | nova/openstack/common/policy.py | 2 | ||||
| -rw-r--r-- | nova/openstack/common/timeutils.py | 4 |
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)) |
