Skip to content

Commit 1e79f38

Browse files
committed
Fix: Configuration read and apply bugs
1 parent c5e605d commit 1e79f38

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: phyto-arm

+5-4
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ def start_container(client, image_name, network_name, config_path: str, name: st
6565
launch_args.append(f"{device_name}:={host_path}")
6666

6767
# And add udp ports
68-
ports = []
68+
ports = {}
6969
for port_name, port_value in process_config.get('udp_ports', {}).items():
7070
if port_name in launch_args:
7171
raise ValueError(f"UDP port name cannot be the same as a launch arg: {port_name}")
72-
ports.append(f"{port_name}:{port_value}/udp")
72+
ports[f'{port_value}/udp'] = port_value
7373
launch_args.append(f"{port_name}:={port_value}")
7474

7575
# Add tcp ports
7676
for port_name, port_value in process_config.get('tcp_ports', {}).items():
7777
if port_name in launch_args:
7878
raise ValueError(f"TCP port name cannot be the same as a launch arg: {port_name}")
79-
ports.append(f"{port_name}:{port_value}/tcp")
79+
ports[f'{port_value}/tcp'] = port_value
8080
launch_args.append(f"{port_name}:={port_value}")
8181

8282
# Build the roslaunch command based on container type
@@ -156,8 +156,9 @@ def start(args):
156156
print(f'Validating config file {args.config} against {args.config_schema}...')
157157
if not validate_config(args.config, args.config_schema):
158158
sys.exit(1)
159+
print('Config is valid')
159160

160-
image_name = config['docker']['image']
161+
image_name = config.get('docker_image') or config.get('docker', {}).get('image')
161162
containers = {}
162163

163164
def cleanup():

0 commit comments

Comments
 (0)