-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(neutron): add no-op trunk driver for understack
This adds an effectively no-op trunk driver for the understack mechanism driver. This allows the trunk plugin to load and work with the undercloud ML2 mechanism. No operations are being performed here so it's just a stub.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from neutron.services.trunk.drivers import base as trunk_base | ||
from neutron_lib.api.definitions import portbindings | ||
from neutron_lib.services.trunk import constants as trunk_consts | ||
from oslo_config import cfg | ||
|
||
SUPPORTED_INTERFACES = (portbindings.VIF_TYPE_OTHER,) | ||
|
||
SUPPORTED_SEGMENTATION_TYPES = (trunk_consts.SEGMENTATION_TYPE_VLAN,) | ||
|
||
|
||
class UnderStackTrunkDriver(trunk_base.DriverBase): | ||
@property | ||
def is_loaded(self): | ||
try: | ||
return "understack" in cfg.CONF.ml2.mechanism_drivers | ||
except cfg.NoSuchOptError: | ||
return False | ||
|
||
@classmethod | ||
def create(cls, plugin_driver): | ||
cls.plugin_driver = plugin_driver | ||
return cls( | ||
"understack", | ||
SUPPORTED_INTERFACES, | ||
SUPPORTED_SEGMENTATION_TYPES, | ||
None, | ||
can_trunk_bound_port=True, | ||
) |