#2887 - Removal of un-necessary code and cleanup following review comments
This commit is contained in:
@@ -167,7 +167,6 @@ class OfficeLANAdder(NetworkNodeAdder, identifier="office_lan"):
|
|||||||
# Optionally include a router in the LAN
|
# Optionally include a router in the LAN
|
||||||
if config.include_router:
|
if config.include_router:
|
||||||
default_gateway = IPv4Address(f"192.168.{config.subnet_base}.1")
|
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(
|
router = Router.from_config(
|
||||||
config={"hostname": f"router_{config.lan_name}", "type": "router", "start_up_duration": 0}
|
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",
|
"type": "computer",
|
||||||
"hostname": f"pc_{i}_{config.lan_name}",
|
"hostname": f"pc_{i}_{config.lan_name}",
|
||||||
"ip_address": f"192.168.{config.subnet_base}.{i+config.pcs_ip_block_start-1}",
|
"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,
|
"start_up_duration": 0,
|
||||||
}
|
}
|
||||||
pc = Computer.from_config(config=pc_cfg)
|
pc = Computer.from_config(config=pc_cfg)
|
||||||
|
|||||||
@@ -2242,10 +2242,6 @@ class Node(SimComponent, ABC):
|
|||||||
for app_id in self.applications:
|
for app_id in self.applications:
|
||||||
self.applications[app_id].close()
|
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):
|
def _start_up_actions(self):
|
||||||
"""Actions to perform when the node is starting up."""
|
"""Actions to perform when the node is starting up."""
|
||||||
# Turn on all the services in the node
|
# 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}")
|
print(f"Starting application:{self.applications[app_id].config.type}")
|
||||||
self.applications[app_id].run()
|
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:
|
def _install_system_software(self) -> None:
|
||||||
"""Preinstall required software."""
|
"""Preinstall required software."""
|
||||||
for _, software_class in self.SYSTEM_SOFTWARE.items():
|
for _, software_class in self.SYSTEM_SOFTWARE.items():
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class Switch(NetworkNode, identifier="switch"):
|
|||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__(**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())
|
self.connect_nic(SwitchPort())
|
||||||
|
|
||||||
def _install_system_software(self):
|
def _install_system_software(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user