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
This commit is contained in:
Boden R 2018-02-20 14:35:07 -07:00
parent 29323bd87b
commit 3c7ac69262

View File

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