daemon: fixed issue for LXC nodes and not properly picking up configured image name to use and for writing to xml

This commit is contained in:
Blake Harnden 2023-02-21 12:06:01 -08:00
parent f10c7cac45
commit 3e5c8c894f
2 changed files with 4 additions and 4 deletions

View file

@ -34,7 +34,7 @@ from core.nodes.base import (
)
from core.nodes.docker import DockerNode, DockerOptions
from core.nodes.interface import CoreInterface
from core.nodes.lxd import LxcNode
from core.nodes.lxd import LxcNode, LxcOptions
from core.nodes.network import CoreNetwork, CtrlNet, PtpNet, WlanNode
from core.nodes.wireless import WirelessNode
from core.services.coreservices import CoreService
@ -81,7 +81,7 @@ def add_node_data(
options.config_services = node_proto.config_services
if isinstance(options, EmaneOptions):
options.emane_model = node_proto.emane
if isinstance(options, DockerOptions):
if isinstance(options, (DockerOptions, LxcOptions)):
options.image = node_proto.image
position = Position()
position.set(node_proto.position.x, node_proto.position.y)

View file

@ -15,7 +15,7 @@ from core.errors import CoreXmlError
from core.nodes.base import CoreNodeBase, CoreNodeOptions, NodeBase, Position
from core.nodes.docker import DockerNode, DockerOptions
from core.nodes.interface import CoreInterface
from core.nodes.lxd import LxcNode
from core.nodes.lxd import LxcNode, LxcOptions
from core.nodes.network import CtrlNet, GreTapBridge, PtpNet, WlanNode
from core.nodes.wireless import WirelessNode
from core.services.coreservices import CoreService
@ -825,7 +825,7 @@ class CoreXmlReader:
options.config_services.extend(
x.get("name") for x in config_service_elements.iterchildren()
)
if isinstance(options, DockerOptions):
if isinstance(options, (DockerOptions, LxcOptions)):
options.image = image
# get position information
position_element = device_element.find("position")