Commit cb68e9b6 by Bach Dániel

add NATIVE_OVS option

parent a7537840
import lxml.etree as ET import lxml.etree as ET
from os import getenv
NATIVE_OVS = getenv('NATIVE_OVS') == 'True'
# VM Instance class # VM Instance class
...@@ -248,7 +252,7 @@ class VMNetwork: ...@@ -248,7 +252,7 @@ class VMNetwork:
bridge="cloud", bridge="cloud",
ipv4=None, ipv4=None,
ipv6=None, ipv6=None,
network_type='ethernet', network_type=None,
virtual_port=None, virtual_port=None,
model='virtio', model='virtio',
QoS=None, QoS=None,
...@@ -256,12 +260,19 @@ class VMNetwork: ...@@ -256,12 +260,19 @@ class VMNetwork:
managed=False): managed=False):
self.name = name self.name = name
self.bridge = bridge self.bridge = bridge
self.network_type = network_type
self.mac = mac self.mac = mac
self.ipv4 = ipv4 self.ipv4 = ipv4
self.ipv6 = ipv6 self.ipv6 = ipv6
self.model = model self.model = model
self.virtual_port = virtual_port if not network_type:
if NATIVE_OVS:
self.network_type = 'bridge',
self.virtual_port = 'openvswitch',
else:
self.network_type = 'ethernet'
else:
self.network_type = network_type
self.virtual_port = virtual_port
self.QoS = QoS self.QoS = QoS
self.vlan = vlan self.vlan = vlan
self.managed = managed self.managed = managed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment