From 3c7ac69262e7f846d00e3a095e98bf98d6fb0ddf Mon Sep 17 00:00:00 2001 From: Boden R Date: Tue, 20 Feb 2018 14:35:07 -0700 Subject: [PATCH] use sorting api def from neutron-lib The sorting extension's API definition was rehomed into neutron-lib with commit I3349b83bc04b82ed333cb6560bbc5d41a7127e94 This patch consumes it by using the API def along with the APIExtensionDescriptor parent class. NeutronLibImpact Change-Id: Ic32b3743c00150e8466475612f481413504f7293 --- neutron/extensions/sorting.py | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/neutron/extensions/sorting.py b/neutron/extensions/sorting.py index f03b3c10caf..b6ff9945f76 100644 --- a/neutron/extensions/sorting.py +++ b/neutron/extensions/sorting.py @@ -11,40 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +from neutron_lib.api.definitions import sorting as apidef from neutron_lib.api import extensions as api_extensions from neutron.api import extensions -_ALIAS = 'sorting' - - -class Sorting(api_extensions.ExtensionDescriptor): +class Sorting(api_extensions.APIExtensionDescriptor): """Fake extension that indicates that sorting is enabled.""" extensions.register_custom_supported_check( - _ALIAS, lambda: True, plugin_agnostic=True + apidef.ALIAS, lambda: True, plugin_agnostic=True ) - @classmethod - def get_name(cls): - return "Sorting support" - - @classmethod - def get_alias(cls): - return _ALIAS - - @classmethod - def get_description(cls): - return "Extension that indicates that sorting is enabled." - - @classmethod - def get_updated(cls): - return "2016-06-12T00:00:00-00:00" - - @classmethod - def get_resources(cls): - return [] - - def get_extended_resources(self, version): - return {} + api_definition = apidef