From 3e5c8c894f7c936c64d87a36fc5b3ed7f59fd3a5 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:06:01 -0800 Subject: [PATCH] daemon: fixed issue for LXC nodes and not properly picking up configured image name to use and for writing to xml --- daemon/core/api/grpc/grpcutils.py | 4 ++-- daemon/core/xml/corexml.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/core/api/grpc/grpcutils.py b/daemon/core/api/grpc/grpcutils.py index 26f2d670..434314a4 100644 --- a/daemon/core/api/grpc/grpcutils.py +++ b/daemon/core/api/grpc/grpcutils.py @@ -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) diff --git a/daemon/core/xml/corexml.py b/daemon/core/xml/corexml.py index a483a8ee..a413fc1a 100644 --- a/daemon/core/xml/corexml.py +++ b/daemon/core/xml/corexml.py @@ -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")