Skip to content

Commit a729f97

Browse files
committed
Add 10.4.24.0/24 route
1 parent fd4a008 commit a729f97

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

meta-hulks/recipes-hulks/network-config/network-config/configure_network

+19-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ based on the team number and the number of the NAO, and sets the hostname.
88

99
from __future__ import annotations
1010

11+
import sys
12+
import tomllib
1113
from pathlib import Path
1214
from subprocess import check_call, check_output
1315
from typing import Any
1416

15-
import tomllib
16-
1717
TEAM_TOML = "/media/internal/team.toml"
1818
HEAD_ID_SCRIPT = "/opt/aldebaran/bin/head_id"
1919
WLAN_NETWORK_PATH = "/etc/systemd/network/20-wlan.network"
@@ -79,7 +79,9 @@ def find_nao_with_head_id(
7979
8080
"""
8181
try:
82-
return next(x for x in configuration["naos"] if x["head_id"] == head_id)
82+
return next(
83+
x for x in configuration["naos"] if x["head_id"] == head_id
84+
)
8385
except StopIteration as error:
8486
msg = f"Could not find NAO with head_id {head_id}"
8587
raise ValueError(msg) from error
@@ -129,6 +131,10 @@ Address=10.1.{team_number}.{nao["number"]}/16
129131
[Route]
130132
Gateway=10.1.24.1
131133
Destination=10.2.24.0/24
134+
135+
[Route]
136+
Gateway=10.1.24.1
137+
Destination=10.4.24.0/24
132138
"""
133139

134140

@@ -163,10 +169,16 @@ if __name__ == "__main__":
163169
except ValueError as error:
164170
print(error)
165171
write_to_file(FALLBACK_NETWORK_PATH, FALLBACK_CONFIGURATION)
166-
exit(1)
167-
168-
wlan_configuration = compose_wlan_network(nao, configuration["team_number"])
169-
wired_configuration = compose_wired_network(nao, configuration["team_number"])
172+
sys.exit(1)
173+
174+
wlan_configuration = compose_wlan_network(
175+
nao,
176+
configuration["team_number"],
177+
)
178+
wired_configuration = compose_wired_network(
179+
nao,
180+
configuration["team_number"],
181+
)
170182

171183
write_to_file(WLAN_NETWORK_PATH, wlan_configuration)
172184
write_to_file(WIRED_NETWORK_PATH, wired_configuration)

0 commit comments

Comments
 (0)