diff options
author | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-09-02 22:17:55 +0000 |
---|---|---|
committer | Tarmac <> | 2011-09-02 22:17:55 +0000 |
commit | 1049a91ef72b09cbff488baec20dc8486d67c475 (patch) | |
tree | afdddbccf6cd44f30db4d7caa943fa700afb51c9 /nova/utils.py | |
parent | 3d542086f23b7b432fe776aed1498f9a7a6ebc7d (diff) | |
parent | d3de96998110185d4b67309808cbd9c488597739 (diff) | |
download | nova-1049a91ef72b09cbff488baec20dc8486d67c475.tar.gz nova-1049a91ef72b09cbff488baec20dc8486d67c475.tar.xz nova-1049a91ef72b09cbff488baec20dc8486d67c475.zip |
Added list of security groups to the newly added extension (Createserverext) for the Create Server and Get Server detail responses.
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py index 21e6221b2..81157a4cd 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -901,3 +901,12 @@ def monkey_patch(): func = import_class("%s.%s" % (module, key)) setattr(sys.modules[module], key,\ decorator("%s.%s" % (module, key), func)) + + +def convert_to_list_dict(lst, label): + """Convert a value or list into a list of dicts""" + if not lst: + return None + if not isinstance(lst, list): + lst = [lst] + return [{label: x} for x in lst] |