From 238fba1cd6d7b36b558213ca3abc33ad71501458 Mon Sep 17 00:00:00 2001 From: Boden R Date: Tue, 14 Nov 2017 14:47:47 -0700 Subject: [PATCH] use net mtu api def from neutron-lib The net mtu extension's API definition was moved into neutron-lib with commit I41d5b399a6bd02f89f2e60c5ccb3fc0944b61255 This patch consumes it by removing the rehomed code and using the APIExtensionDescriptor for the parent class of the extension. NeutronLibImpact Change-Id: I0bc7ba5e1e267183e9b440bedcdbe373e635297e --- neutron/extensions/netmtu.py | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/neutron/extensions/netmtu.py b/neutron/extensions/netmtu.py index 061b2e81e65..a08e323ae69 100644 --- a/neutron/extensions/netmtu.py +++ b/neutron/extensions/netmtu.py @@ -12,39 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.api.definitions import network_mtu as apidef from neutron_lib.api import extensions -MTU = 'mtu' -EXTENDED_ATTRIBUTES_2_0 = { - 'networks': { - MTU: {'allow_post': False, 'allow_put': False, - 'is_visible': True}, - }, -} - - -class Netmtu(extensions.ExtensionDescriptor): +class Netmtu(extensions.APIExtensionDescriptor): """Extension class supporting network MTU.""" - @classmethod - def get_name(cls): - return "Network MTU" - - @classmethod - def get_alias(cls): - return "net-mtu" - - @classmethod - def get_description(cls): - return "Provides MTU attribute for a network resource." - - @classmethod - def get_updated(cls): - return "2015-03-25T10:00:00-00:00" - - def get_extended_resources(self, version): - if version == "2.0": - return EXTENDED_ATTRIBUTES_2_0 - else: - return {} + api_definition = apidef