summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-11-19 10:54:28 +0100
committerCorentin LABBE <clabbe@baylibre.com>2018-11-20 12:15:37 +0100
commit17d04b53f1e857ce95c3917c7cc9f90fc45e4dcc (patch)
tree0d71301ce90ba093d69cd35bbfa6e20956d0b67a /lavalab-gen.py
parentf7ea4ac6d1197d0d5b2a45456e5d4abb964a2726 (diff)
lavalab-gen.py: support adding ser2net options
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 9eae28e..4287efc 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -38,9 +38,6 @@ template_device_pdu_generic = string.Template("""
{% set power_on_command = '${power_on_command}' %}
""")
-template_ser2net = string.Template("""
-${port}:telnet:600:/dev/${board}:${baud} 8DATABITS NONE 1STOPBIT banner
-""")
template_device_ser2net = string.Template("""
{% set connection_command = 'telnet 127.0.0.1 ${port}' %}
""")
@@ -482,13 +479,16 @@ def main():
if not worker_name in ser2net_ports:
ser2net_ports[worker_name] = ser2net_port_start
fp = open("%s/ser2net.conf" % workerdir, "a")
- fp.write("DEFAULT:max-connections:10")
+ fp.write("DEFAULT:max-connections:10\n")
fp.close()
- ser2net_line = template_ser2net.substitute(port=ser2net_ports[worker_name],baud=baud,board=board_name)
+ ser2net_line = "%d:telnet:600:/dev/%s:%d 8DATABITS NONE 1STOPBIT" % (ser2net_ports[worker_name], board_name, baud)
+ if "ser2net_options" in uart:
+ for ser2net_option in uart["ser2net_options"]:
+ ser2net_line += " %s" % ser2net_option
device_line += template_device_ser2net.substitute(port=ser2net_ports[worker_name])
ser2net_ports[worker_name] += 1
fp = open("%s/ser2net.conf" % workerdir, "a")
- fp.write(ser2net_line)
+ fp.write(ser2net_line + " banner\n")
fp.close()
if use_screen:
device_line += template_device_screen.substitute(board=board_name)