Merge "Check add/remove flavor access APIs attributes"
This commit is contained in:
commit
2a9d1588ae
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
list_flavor_access = {
|
add_remove_list_flavor_access = {
|
||||||
'status_code': [200],
|
'status_code': [200],
|
||||||
'response_body': {
|
'response_body': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
|
@ -130,7 +130,8 @@ class FlavorsClientJSON(rest_client.RestClient):
|
|||||||
"""Gets flavor access information given the flavor id."""
|
"""Gets flavor access information given the flavor id."""
|
||||||
resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
|
resp, body = self.get('flavors/%s/os-flavor-access' % flavor_id)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
self.validate_response(schema_access.list_flavor_access, resp, body)
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
|
||||||
def add_flavor_access(self, flavor_id, tenant_id):
|
def add_flavor_access(self, flavor_id, tenant_id):
|
||||||
@ -143,6 +144,8 @@ class FlavorsClientJSON(rest_client.RestClient):
|
|||||||
post_body = json.dumps(post_body)
|
post_body = json.dumps(post_body)
|
||||||
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
|
||||||
def remove_flavor_access(self, flavor_id, tenant_id):
|
def remove_flavor_access(self, flavor_id, tenant_id):
|
||||||
@ -155,4 +158,6 @@ class FlavorsClientJSON(rest_client.RestClient):
|
|||||||
post_body = json.dumps(post_body)
|
post_body = json.dumps(post_body)
|
||||||
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
@ -130,7 +130,8 @@ class FlavorsV3ClientJSON(rest_client.RestClient):
|
|||||||
"""Gets flavor access information given the flavor id."""
|
"""Gets flavor access information given the flavor id."""
|
||||||
resp, body = self.get('flavors/%s/flavor-access' % flavor_id)
|
resp, body = self.get('flavors/%s/flavor-access' % flavor_id)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
self.validate_response(schema_access.list_flavor_access, resp, body)
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
|
||||||
def add_flavor_access(self, flavor_id, tenant_id):
|
def add_flavor_access(self, flavor_id, tenant_id):
|
||||||
@ -143,6 +144,8 @@ class FlavorsV3ClientJSON(rest_client.RestClient):
|
|||||||
post_body = json.dumps(post_body)
|
post_body = json.dumps(post_body)
|
||||||
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
|
||||||
def remove_flavor_access(self, flavor_id, tenant_id):
|
def remove_flavor_access(self, flavor_id, tenant_id):
|
||||||
@ -155,4 +158,6 @@ class FlavorsV3ClientJSON(rest_client.RestClient):
|
|||||||
post_body = json.dumps(post_body)
|
post_body = json.dumps(post_body)
|
||||||
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
resp, body = self.post('flavors/%s/action' % flavor_id, post_body)
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
|
self.validate_response(schema_access.add_remove_list_flavor_access,
|
||||||
|
resp, body)
|
||||||
return resp, body['flavor_access']
|
return resp, body['flavor_access']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user