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.