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:
parent
b94d4d3507
commit
f4224d1b80
7 changed files with 20 additions and 8 deletions
|
@ -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:
|
||||
"""
|
||||
|
|
|
@ -68,8 +68,9 @@ class CoreInterface:
|
|||
# id used to find flow data
|
||||
self.flow_id: Optional[int] = None
|
||||
self.server: Optional["DistributedServer"] = server
|
||||
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
|
||||
)
|
||||
|
||||
def host_cmd(
|
||||
self,
|
||||
|
|
|
@ -756,7 +756,7 @@ class CtrlNet(CoreNetwork):
|
|||
:param index: starting address index
|
||||
:return: nothing
|
||||
"""
|
||||
use_ovs = self.session.options.get_config("ovs") == "True"
|
||||
use_ovs = self.session.use_ovs()
|
||||
address = self.prefix[index]
|
||||
current = f"{address}/{self.prefix.prefixlen}"
|
||||
net_client = get_net_client(use_ovs, utils.cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue