vmware-neutron-driver 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: vmware-neutron-driver
3
+ Version: 0.1.0
4
+ Summary: VMware Workstation ML2 mechanism driver
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: neutron-lib
File without changes
@@ -0,0 +1,73 @@
1
+ import logging
2
+
3
+ from neutron_lib.plugins.ml2 import api
4
+ from neutron_lib import constants as n_const
5
+
6
+ LOG = logging.getLogger(__name__)
7
+
8
+ class VMwareWorkstationMechanismDriver(api.MechanismDriver):
9
+
10
+ def initialize(self):
11
+ self.network_vmnet_map = {}
12
+
13
+ def bind_port(self, context):
14
+ network = context.network.current
15
+ network_id = network["id"]
16
+
17
+ LOG.warning(
18
+ "VMware bind_port called: network=%s port=%s",
19
+ network_id,
20
+ context.current["id"],
21
+ )
22
+
23
+ LOG.warning(
24
+ "Network segments: %s",
25
+ context.network.network_segments,
26
+ )
27
+
28
+ for segment in context.network.network_segments:
29
+
30
+ LOG.warning(
31
+ "Checking segment: %s",
32
+ segment,
33
+ )
34
+
35
+ if segment["network_type"] != n_const.TYPE_FLAT:
36
+ LOG.warning(
37
+ "Ignoring non-flat segment: %s",
38
+ segment["network_type"],
39
+ )
40
+ continue
41
+
42
+ vmnet = segment.get("physical_network")
43
+
44
+ if not vmnet:
45
+ vmnet = "vmnet2"
46
+ self.network_vmnet_map[network_id] = vmnet
47
+
48
+ LOG.warning(
49
+ "Binding port=%s to vmnet=%s",
50
+ context.current["id"],
51
+ vmnet,
52
+ )
53
+
54
+ context.set_binding(
55
+ segment["id"],
56
+ "vmware_workstation",
57
+ {
58
+ "vmnet": vmnet,
59
+ "cap_port_filter": False,
60
+ },
61
+ )
62
+
63
+ LOG.warning(
64
+ "VMware binding successfully set for port=%s",
65
+ context.current["id"],
66
+ )
67
+
68
+ return
69
+
70
+ LOG.error(
71
+ "VMware driver could NOT bind port=%s: no FLAT segment",
72
+ context.current["id"],
73
+ )
@@ -0,0 +1,16 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vmware-neutron-driver"
7
+ version = "0.1.0"
8
+ description = "VMware Workstation ML2 mechanism driver"
9
+ requires-python = ">=3.10"
10
+ license = "Apache-2.0"
11
+ dependencies = [
12
+ "neutron-lib",
13
+ ]
14
+
15
+ [project.entry-points."neutron.ml2.mechanism_drivers"]
16
+ vmware_workstation = "driver.mechanism_driver:VMwareWorkstationMechanismDriver"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: vmware-neutron-driver
3
+ Version: 0.1.0
4
+ Summary: VMware Workstation ML2 mechanism driver
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: neutron-lib
@@ -0,0 +1,9 @@
1
+ pyproject.toml
2
+ driver/__init__.py
3
+ driver/mechanism_driver.py
4
+ vmware_neutron_driver.egg-info/PKG-INFO
5
+ vmware_neutron_driver.egg-info/SOURCES.txt
6
+ vmware_neutron_driver.egg-info/dependency_links.txt
7
+ vmware_neutron_driver.egg-info/entry_points.txt
8
+ vmware_neutron_driver.egg-info/requires.txt
9
+ vmware_neutron_driver.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [neutron.ml2.mechanism_drivers]
2
+ vmware_workstation = driver.mechanism_driver:VMwareWorkstationMechanismDriver