Skip to content

Commit

Permalink
Add 10.4.24.0/24 route (#32)
Browse files Browse the repository at this point in the history
* Add 10.4.24.0/24 route

* increase os version
  • Loading branch information
schmidma authored Jan 18, 2025
1 parent fd4a008 commit a8a38e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion meta-hulks/conf/distro/HULKs-OS.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ SUMMARY = "HULKs flavoured Nao"

DISTRO = "HULKs-OS"
DISTRO_NAME = "HULKs-OS"
DISTRO_VERSION = "8.0.2"
DISTRO_VERSION = "8.0.3"
SDKIMAGE_FEATURES:remove = "dbg-pkgs src-pkgs"
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ based on the team number and the number of the NAO, and sets the hostname.

from __future__ import annotations

import sys
import tomllib
from pathlib import Path
from subprocess import check_call, check_output
from typing import Any

import tomllib

TEAM_TOML = "/media/internal/team.toml"
HEAD_ID_SCRIPT = "/opt/aldebaran/bin/head_id"
WLAN_NETWORK_PATH = "/etc/systemd/network/20-wlan.network"
Expand Down Expand Up @@ -79,7 +79,9 @@ def find_nao_with_head_id(
"""
try:
return next(x for x in configuration["naos"] if x["head_id"] == head_id)
return next(
x for x in configuration["naos"] if x["head_id"] == head_id
)
except StopIteration as error:
msg = f"Could not find NAO with head_id {head_id}"
raise ValueError(msg) from error
Expand Down Expand Up @@ -129,6 +131,10 @@ Address=10.1.{team_number}.{nao["number"]}/16
[Route]
Gateway=10.1.24.1
Destination=10.2.24.0/24
[Route]
Gateway=10.1.24.1
Destination=10.4.24.0/24
"""


Expand Down Expand Up @@ -163,10 +169,16 @@ if __name__ == "__main__":
except ValueError as error:
print(error)
write_to_file(FALLBACK_NETWORK_PATH, FALLBACK_CONFIGURATION)
exit(1)

wlan_configuration = compose_wlan_network(nao, configuration["team_number"])
wired_configuration = compose_wired_network(nao, configuration["team_number"])
sys.exit(1)

wlan_configuration = compose_wlan_network(
nao,
configuration["team_number"],
)
wired_configuration = compose_wired_network(
nao,
configuration["team_number"],
)

write_to_file(WLAN_NETWORK_PATH, wlan_configuration)
write_to_file(WIRED_NETWORK_PATH, wired_configuration)
Expand Down

0 comments on commit a8a38e8

Please sign in to comment.