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
This commit is contained in:
Boden R 2017-11-14 14:47:47 -07:00
parent 6277b4a202
commit 238fba1cd6
1 changed files with 3 additions and 31 deletions

View File

@ -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