updates to lxd/docker to work with net_cmd/node_net_cmd

This commit is contained in:
Blake Harnden 2019-10-14 14:28:18 -07:00
parent 82bdbd776b
commit 5f282bb695
5 changed files with 122 additions and 72 deletions

View file

@ -452,14 +452,24 @@ class CoreNode(CoreNodeBase):
self._mounts = []
self.bootsh = bootsh
if session.options.get_config("ovs") == "True":
self.node_net_client = OvsNetClient(self.node_net_cmd)
else:
self.node_net_client = LinuxNetClient(self.node_net_cmd)
use_ovs = session.options.get_config("ovs") == "True"
self.node_net_client = self.create_node_net_client(use_ovs)
if start:
self.startup()
def create_node_net_client(self, use_ovs):
"""
Create a client for running network orchestration commands.
:param bool use_ovs: True to use OVS bridges, False for Linux bridge
:return: network client
"""
if use_ovs:
return OvsNetClient(self.node_net_cmd)
else:
return LinuxNetClient(self.node_net_cmd)
def alive(self):
"""
Check if the node is alive.
@ -584,7 +594,7 @@ class CoreNode(CoreNodeBase):
:param str sh: shell to execute command in
:return: str
"""
return self.client.termcmdstring(sh)
return self.client.create_cmd(sh)
def privatedir(self, path):
"""