use l3 flavors api def from neutron-lib

The l3 flavor extension's API definition was rehomed into neutron-lib
with commit I354911795bcd3174f73af13360ac110344a1ee8f
This patch consumes the API def by removing the rehomed code and using
the APIExtensionDescriptor for the parent class of the l3 flavors
extension.

NeutronLibImpact

Change-Id: Iec46b653ab11369570ecbeef8980f1ef500cbb91
This commit is contained in:
Boden R 2017-11-10 10:56:51 -07:00
parent 8e9959725e
commit 4e768bc648

View File

@ -12,44 +12,11 @@
# under the License.
#
from neutron_lib.api.definitions import l3_flavors as apidef
from neutron_lib.api import extensions
from neutron_lib import constants
EXTENDED_ATTRIBUTES_2_0 = {
'routers': {
'flavor_id': {'allow_post': True, 'allow_put': False,
'default': constants.ATTR_NOT_SPECIFIED,
'is_visible': True, 'enforce_policy': True}
}
}
class L3_flavors(extensions.ExtensionDescriptor):
class L3_flavors(extensions.APIExtensionDescriptor):
"""Extension class supporting flavors for routers."""
@classmethod
def get_name(cls):
return "Router Flavor Extension"
@classmethod
def get_alias(cls):
return 'l3-flavors'
@classmethod
def get_description(cls):
return "Flavor support for routers."
@classmethod
def get_updated(cls):
return "2016-05-17T00:00:00-00:00"
def get_extended_resources(self, version):
if version == "2.0":
return EXTENDED_ATTRIBUTES_2_0
else:
return {}
def get_required_extensions(self):
return ["router", "flavors"]
api_definition = apidef