diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-05-23 22:51:08 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-05-23 22:51:08 +0000 |
commit | 55659b1f387d2a5caa957794801b6ce00305240a (patch) | |
tree | 0440315e87905a2c18e5913f6fcd02acb2317d5e /nova/utils.py | |
parent | 2c6057754af844d8be0bd347ba4c179860053585 (diff) | |
parent | 96164cecc6b7bf447d06896f723dab416e63ee06 (diff) | |
download | nova-55659b1f387d2a5caa957794801b6ce00305240a.tar.gz nova-55659b1f387d2a5caa957794801b6ce00305240a.tar.xz nova-55659b1f387d2a5caa957794801b6ce00305240a.zip |
Merge "Make a few places tolerant of sys_meta being a dict"
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py index 3e9d8c597..97551e8eb 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1032,6 +1032,13 @@ def dict_to_metadata(metadata): return result +def instance_sys_meta(instance): + if isinstance(instance['system_metadata'], dict): + return instance['system_metadata'] + else: + return metadata_to_dict(instance['system_metadata']) + + def get_wrapped_function(function): """Get the method at the bottom of a stack of decorators.""" if not hasattr(function, 'func_closure') or not function.func_closure: |