summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py7
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: