#2887 - Removal of un-necessary code and cleanup following review comments

This commit is contained in:
Charlie Crane
2025-02-04 14:25:26 +00:00
parent 05946431ca
commit 99e38fbbc2
3 changed files with 2 additions and 11 deletions

View File

@@ -167,7 +167,6 @@ class OfficeLANAdder(NetworkNodeAdder, identifier="office_lan"):
# Optionally include a router in the LAN
if config.include_router:
default_gateway = IPv4Address(f"192.168.{config.subnet_base}.1")
# router = Router(hostname=f"router_{config.lan_name}", start_up_duration=0)
router = Router.from_config(
config={"hostname": f"router_{config.lan_name}", "type": "router", "start_up_duration": 0}
)
@@ -230,7 +229,7 @@ class OfficeLANAdder(NetworkNodeAdder, identifier="office_lan"):
"type": "computer",
"hostname": f"pc_{i}_{config.lan_name}",
"ip_address": f"192.168.{config.subnet_base}.{i+config.pcs_ip_block_start-1}",
"default_gateway": "192.168.10.1",
"default_gateway": default_gateway,
"start_up_duration": 0,
}
pc = Computer.from_config(config=pc_cfg)

View File

@@ -2242,10 +2242,6 @@ class Node(SimComponent, ABC):
for app_id in self.applications:
self.applications[app_id].close()
# Turn off all processes in the node
# for process_id in self.processes:
# self.processes[process_id]
def _start_up_actions(self):
"""Actions to perform when the node is starting up."""
# Turn on all the services in the node
@@ -2258,10 +2254,6 @@ class Node(SimComponent, ABC):
print(f"Starting application:{self.applications[app_id].config.type}")
self.applications[app_id].run()
# Turn off all processes in the node
# for process_id in self.processes:
# self.processes[process_id]
def _install_system_software(self) -> None:
"""Preinstall required software."""
for _, software_class in self.SYSTEM_SOFTWARE.items():

View File

@@ -109,7 +109,7 @@ class Switch(NetworkNode, identifier="switch"):
def __init__(self, **kwargs):
super().__init__(**kwargs)
for i in range(1, kwargs["config"].num_ports + 1):
for i in range(1, self.config.num_ports + 1):
self.connect_nic(SwitchPort())
def _install_system_software(self):