Forbid availability_zone None in aggregate Nova API
In aggregate API, argument "availability_zone" became optional in the request.
Fixed tempest code same as nova.
Change-Id: I73f42c6c069a9bc6318ac3bac5ec94b61c65ecaf
Related-bug: #1252177
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index d9e73de..30677b9 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -38,13 +38,9 @@
body = json.loads(body)
return resp, body['aggregate']
- def create_aggregate(self, name, availability_zone=None):
+ def create_aggregate(self, **kwargs):
"""Creates a new aggregate."""
- post_body = {
- 'name': name,
- 'availability_zone': availability_zone,
- }
- post_body = json.dumps({'aggregate': post_body})
+ post_body = json.dumps({'aggregate': kwargs})
resp, body = self.post('os-aggregates', post_body, self.headers)
body = json.loads(body)
diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py
index d63be02..5fef3ba 100644
--- a/tempest/services/compute/v3/json/aggregates_client.py
+++ b/tempest/services/compute/v3/json/aggregates_client.py
@@ -39,13 +39,9 @@
body = json.loads(body)
return resp, body['aggregate']
- def create_aggregate(self, name, availability_zone=None):
+ def create_aggregate(self, **kwargs):
"""Creates a new aggregate."""
- post_body = {
- 'name': name,
- 'availability_zone': availability_zone,
- }
- post_body = json.dumps({'aggregate': post_body})
+ post_body = json.dumps({'aggregate': kwargs})
resp, body = self.post('os-aggregates', post_body, self.headers)
body = json.loads(body)