Merge "use net mtu api def from neutron-lib"

This commit is contained in:
Zuul 2017-11-15 20:30:16 +00:00 committed by Gerrit Code Review
commit 7f1b6043bd
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