@@ -8,12 +8,12 @@ based on the team number and the number of the NAO, and sets the hostname.
8
8
9
9
from __future__ import annotations
10
10
11
+ import sys
12
+ import tomllib
11
13
from pathlib import Path
12
14
from subprocess import check_call , check_output
13
15
from typing import Any
14
16
15
- import tomllib
16
-
17
17
TEAM_TOML = "/media/internal/team.toml"
18
18
HEAD_ID_SCRIPT = "/opt/aldebaran/bin/head_id"
19
19
WLAN_NETWORK_PATH = "/etc/systemd/network/20-wlan.network"
@@ -79,7 +79,9 @@ def find_nao_with_head_id(
79
79
80
80
"""
81
81
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
+ )
83
85
except StopIteration as error :
84
86
msg = f"Could not find NAO with head_id { head_id } "
85
87
raise ValueError (msg ) from error
@@ -129,6 +131,10 @@ Address=10.1.{team_number}.{nao["number"]}/16
129
131
[Route]
130
132
Gateway=10.1.24.1
131
133
Destination=10.2.24.0/24
134
+
135
+ [Route]
136
+ Gateway=10.1.24.1
137
+ Destination=10.4.24.0/24
132
138
"""
133
139
134
140
@@ -163,10 +169,16 @@ if __name__ == "__main__":
163
169
except ValueError as error :
164
170
print (error )
165
171
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
+ )
170
182
171
183
write_to_file (WLAN_NETWORK_PATH , wlan_configuration )
172
184
write_to_file (WIRED_NETWORK_PATH , wired_configuration )
0 commit comments