summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-03-23 05:50:53 +0000
committerRick Harris <rick.harris@rackspace.com>2011-03-23 05:50:53 +0000
commita7c9ad393f72b49515a445504a5bc87f8a26932c (patch)
tree08adde949d5c1a4d595ebd2dfb55ad9d6cc1bee6 /nova/utils.py
parent65e8e24b794203de5496182dd089f5512e7313b4 (diff)
downloadnova-a7c9ad393f72b49515a445504a5bc87f8a26932c.tar.gz
nova-a7c9ad393f72b49515a445504a5bc87f8a26932c.tar.xz
nova-a7c9ad393f72b49515a445504a5bc87f8a26932c.zip
Filtering images by user_id now
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 7b96a0daf..d114cb14f 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -629,3 +629,9 @@ def map_dict_keys(dict_, key_map):
mapped_key = key_map[key] if key in key_map else key
mapped[mapped_key] = value
return mapped
+
+
+def subset_dict(dict_, keys):
+ """Return a dict that only contains a subset of keys"""
+ subset = partition_dict(dict_, keys)[0]
+ return subset