daemon: removed generation of the session nodes file, this information should be available through grpc

This commit is contained in:
Blake Harnden 2022-08-31 17:03:31 -07:00
parent 382ff6d49b
commit e56d93f0fe
2 changed files with 0 additions and 19 deletions

View file

@ -522,7 +522,6 @@ class Session:
# boot core nodes after runtime # boot core nodes after runtime
is_runtime = self.state == EventTypes.RUNTIME_STATE is_runtime = self.state == EventTypes.RUNTIME_STATE
if is_runtime and isinstance(node, CoreNode): if is_runtime and isinstance(node, CoreNode):
self.write_nodes()
self.add_remove_control_iface(node, remove=False) self.add_remove_control_iface(node, remove=False)
self.boot_node(node) self.boot_node(node)
self.sdt.add_node(node) self.sdt.add_node(node)
@ -997,21 +996,6 @@ class Session:
for node_id in nodes_ids: for node_id in nodes_ids:
self.sdt.delete_node(node_id) self.sdt.delete_node(node_id)
def write_nodes(self) -> None:
"""
Write nodes to a 'nodes' file in the session dir.
The 'nodes' file lists: number, name, api-type, class-type
"""
file_path = self.directory / "nodes"
try:
with self.nodes_lock:
with file_path.open("w") as f:
for _id, node in self.nodes.items():
node_type = self.get_node_type(type(node))
f.write(f"{_id} {node.name} {node_type} {type(node)}\n")
except IOError:
logger.exception("error writing nodes file")
def exception( def exception(
self, level: ExceptionLevels, source: str, text: str, node_id: int = None self, level: ExceptionLevels, source: str, text: str, node_id: int = None
) -> None: ) -> None:
@ -1045,8 +1029,6 @@ class Session:
if self.state == EventTypes.RUNTIME_STATE: if self.state == EventTypes.RUNTIME_STATE:
logger.warning("ignoring instantiate, already in runtime state") logger.warning("ignoring instantiate, already in runtime state")
return [] return []
# write current nodes out to session directory file
self.write_nodes()
# create control net interfaces and network tunnels # create control net interfaces and network tunnels
# which need to exist for emane to sync on location events # which need to exist for emane to sync on location events
# in distributed scenarios # in distributed scenarios

View file

@ -60,7 +60,6 @@ def patcher(request):
) )
patch_manager.patch_obj(CoreNode, "create_file") patch_manager.patch_obj(CoreNode, "create_file")
patch_manager.patch_obj(Session, "write_state") patch_manager.patch_obj(Session, "write_state")
patch_manager.patch_obj(Session, "write_nodes")
yield patch_manager yield patch_manager
patch_manager.shutdown() patch_manager.shutdown()