From 4e768bc64895eb52e5ff2f5e6322d8f359fc9f74 Mon Sep 17 00:00:00 2001 From: Boden R Date: Fri, 10 Nov 2017 10:56:51 -0700 Subject: [PATCH] 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 --- neutron/extensions/l3_flavors.py | 39 +++----------------------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/neutron/extensions/l3_flavors.py b/neutron/extensions/l3_flavors.py index 3f397c579ee..976e7c3b11b 100644 --- a/neutron/extensions/l3_flavors.py +++ b/neutron/extensions/l3_flavors.py @@ -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