diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index a686ce9e..329f5587 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -1556,9 +1556,10 @@ class Session: funcs = [] for node_id in self.nodes: node = self.nodes[node_id] - if isinstance(node, CoreNodeBase): - args = (node,) - funcs.append((self.services.stop_services, args, {})) + if not isinstance(node, CoreNodeBase) or not node.up: + continue + args = (node,) + funcs.append((self.services.stop_services, args, {})) utils.threadpool(funcs) # shutdown emane diff --git a/daemon/core/nodes/base.py b/daemon/core/nodes/base.py index 19951efa..4f9d1e37 100644 --- a/daemon/core/nodes/base.py +++ b/daemon/core/nodes/base.py @@ -284,6 +284,7 @@ class CoreNodeBase(NodeBase): self.config_services = {} self.nodedir = None self.tmpnodedir = False + self.up = False def add_config_service(self, service_class: "ConfigServiceType") -> None: """ @@ -503,7 +504,6 @@ class CoreNode(CoreNodeBase): ) self.client = None self.pid = None - self.up = False self.lock = threading.RLock() self._mounts = [] self.bootsh = bootsh diff --git a/daemon/core/nodes/physical.py b/daemon/core/nodes/physical.py index d947c269..8959fda1 100644 --- a/daemon/core/nodes/physical.py +++ b/daemon/core/nodes/physical.py @@ -289,7 +289,6 @@ class Rj45Node(CoreNodeBase, CoreInterface): """ CoreNodeBase.__init__(self, session, _id, name, start, server) CoreInterface.__init__(self, session, self, name, mtu, server) - self.up = False self.lock = threading.RLock() self.ifindex = None # the following are PyCoreNetIf attributes diff --git a/daemon/core/xml/corexml.py b/daemon/core/xml/corexml.py index a91f8a6c..1f402510 100644 --- a/daemon/core/xml/corexml.py +++ b/daemon/core/xml/corexml.py @@ -923,20 +923,14 @@ class CoreXmlReader: if link_options.unidirectional == 1 and node_set in node_sets: logging.info( - "updating link node_one(%s) node_two(%s): %s", - node_one, - node_two, - link_options, + "updating link node_one(%s) node_two(%s)", node_one, node_two ) self.session.update_link( node_one, node_two, interface_one.id, interface_two.id, link_options ) else: logging.info( - "adding link node_one(%s) node_two(%s): %s", - node_one, - node_two, - link_options, + "adding link node_one(%s) node_two(%s)", node_one, node_two ) self.session.add_link( node_one, node_two, interface_one, interface_two, link_options