summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-28 22:55:01 +0000
committerGerrit Code Review <review@openstack.org>2012-11-28 22:55:01 +0000
commit0c618982f790cca34729ef3fcd001e566a15de8d (patch)
treeedf6bd49e73402fd37f21090ff00c5084ab23172 /nova/compute
parentaaa1c3145a39e7b850edebcc8262b5da751fb8af (diff)
parent8c7fe145a76793c42786d9baaea63301c3dd5b6e (diff)
Merge "Include 'hosts' and 'metadetails' in aggregate."
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index c937b7cf5..79db499bd 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -2159,7 +2159,11 @@ class AggregateAPI(base.Base):
values = {"name": aggregate_name,
"availability_zone": availability_zone}
aggregate = self.db.aggregate_create(context, values)
- return dict(aggregate.iteritems())
+ aggregate = self._get_aggregate_info(context, aggregate)
+ # To maintain the same API result as before.
+ del aggregate['hosts']
+ del aggregate['metadata']
+ return aggregate
else:
raise exception.InvalidAggregateAction(action='create_aggregate',
aggregate_id="'N/A'",
@@ -2236,6 +2240,9 @@ class AggregateAPI(base.Base):
metadata = self.db.aggregate_metadata_get(context, aggregate.id)
hosts = self.db.aggregate_host_get_all(context, aggregate.id)
result = dict(aggregate.iteritems())
+ # metadetails was not originally included here. We need to pull it
+ # back out to maintain API stability.
+ del result['metadetails']
result["metadata"] = metadata
result["hosts"] = hosts
return result