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

@ -73,8 +73,9 @@ class NodeBase(abc.ABC):
self.icon: Optional[str] = None
self.position: Position = Position()
self.up: bool = False
use_ovs = session.options.get_config("ovs") == "True"
self.net_client: LinuxNetClient = get_net_client(use_ovs, self.host_cmd)
self.net_client: LinuxNetClient = get_net_client(
self.session.use_ovs(), self.host_cmd
)
@abc.abstractmethod
def startup(self) -> None:
@ -471,8 +472,9 @@ class CoreNode(CoreNodeBase):
self.pid: Optional[int] = None
self.lock: RLock = RLock()
self._mounts: List[Tuple[str, str]] = []
use_ovs = session.options.get_config("ovs") == "True"
self.node_net_client: LinuxNetClient = self.create_node_net_client(use_ovs)
self.node_net_client: LinuxNetClient = self.create_node_net_client(
self.session.use_ovs()
)
def create_node_net_client(self, use_ovs: bool) -> LinuxNetClient:
"""