Check flavor type before add tenant access

Currently we allow tenant access for public flavor, however,
we can't query it after that because flavor is public.
This patch adds check for add access function to raise exception
if the flavor is public.

Also, a nit change is use methods introduced in
793bcc07b9 to get flavor.

APIImpact: Adds new 2.7 API microversion due to new error condition
           in flavor access API
Implements blueprint check-flavor-type-before-add-tenant
Closes-Bug: #1361476

Change-Id: I461175e9969a0dd5b2b7ef75ea7d9f36f3a306d0
This commit is contained in:
jichenjc
2014-09-21 03:16:32 +08:00
committed by Sergey Nikitin
parent 0d696adcea
commit 6abb88befe
7 changed files with 63 additions and 6 deletions

View File

@@ -45,6 +45,7 @@ REST_API_VERSION_HISTORY = """REST API Version History:
* 2.4 - Exposes reserved field in os-fixed-ips.
* 2.5 - Allow server search option ip6 for non-admin
* 2.6 - Consolidate the APIs for getting remote consoles
* 2.7 - Check flavor type before add tenant access.
"""
# The minimum and maximum versions of the API supported
@@ -53,7 +54,7 @@ REST_API_VERSION_HISTORY = """REST API Version History:
# Note(cyeoh): This only applies for the v2.1 API once microversions
# support is fully merged. It does not affect the V2 API.
_MIN_API_VERSION = "2.1"
_MAX_API_VERSION = "2.6"
_MAX_API_VERSION = "2.7"
DEFAULT_API_VERSION = _MIN_API_VERSION