daemon: updated ovs option to be a formal session option, will now display within gui, save to and be read from xml

This commit is contained in:
Blake Harnden 2020-06-25 22:05:10 -07:00
parent b94d4d3507
commit f4224d1b80
7 changed files with 20 additions and 8 deletions

View file

@ -80,7 +80,7 @@ class CoreEmu:
:raises core.errors.CoreError: when an executable does not exist on path
"""
requirements = COMMON_REQUIREMENTS
use_ovs = self.config.get("ovs") == "True"
use_ovs = self.config.get("ovs") == "1"
if use_ovs:
requirements += OVS_REQUIREMENTS
else:

View file

@ -217,6 +217,9 @@ class Session:
else:
common_network.unlink(iface1, iface2)
def use_ovs(self) -> bool:
return self.options.get_config("ovs") == "1"
def add_link(
self,
node1_id: int,

View file

@ -56,6 +56,9 @@ class SessionConfig(ConfigurableManager, ConfigurableOptions):
default=Sdt.DEFAULT_SDT_URL,
label="SDT3D URL",
),
Configuration(
_id="ovs", _type=ConfigDataTypes.BOOL, default="0", label="Enable OVS"
),
]
config_type: RegisterTlvs = RegisterTlvs.UTILITY