From b4e33e5e7aba062027765ed56912ad8da4ca8351 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 27 Jul 2020 18:06:35 +0000 Subject: [PATCH] Add "supported_extensions" method to MechanismDriver This method returns the supported plugin extensions, given a set of them. Each mechanism driver will be able to implement each own filtering method. By default, the method will return the same set of extensions without any filtering. Related-Bug: #1888829 Change-Id: I6fd62f6f393b635e6710020adab736a09a142556 --- neutron_lib/plugins/ml2/api.py | 15 +++++++++++++++ ...ver_supported_extensions-67e1b0b763571ae9.yaml | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 releasenotes/notes/mechanism_driver_supported_extensions-67e1b0b763571ae9.yaml diff --git a/neutron_lib/plugins/ml2/api.py b/neutron_lib/plugins/ml2/api.py index 05be3057b..e6ccbf805 100644 --- a/neutron_lib/plugins/ml2/api.py +++ b/neutron_lib/plugins/ml2/api.py @@ -455,6 +455,21 @@ class MechanismDriver(object, metaclass=abc.ABCMeta): """ return [] + def supported_extensions(self, extensions): + """Return the mechanism driver supported extensions + + By default this method will return the same provided set, without any + filtering. In case any particular mechanism driver needs to filter out + any specific extension or supports only a reduced set of extensions, + this method should be override. + + :param extensions: set of extensions supported by the instance that + created this mechanism driver. + :returns: a set of the extensions currently supported by this + mechanism driver + """ + return extensions + class _TypeDriverBase(object, metaclass=abc.ABCMeta): diff --git a/releasenotes/notes/mechanism_driver_supported_extensions-67e1b0b763571ae9.yaml b/releasenotes/notes/mechanism_driver_supported_extensions-67e1b0b763571ae9.yaml new file mode 100644 index 000000000..e7bb50192 --- /dev/null +++ b/releasenotes/notes/mechanism_driver_supported_extensions-67e1b0b763571ae9.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add ``supported_extensions`` method to ``MechanismDriver``. This method + provides an standard API to implement, per mechanism driver, a way to + filter the supported extensions. By default, this method will return the + same set of extensions passed.