From 4278e548edc710a4432d3badadb9ae3644937a9c Mon Sep 17 00:00:00 2001 From: Corentin LABBE Date: Thu, 11 Jan 2018 16:56:25 +0100 Subject: Implement connection_command connection_command is a generic way to get console from devices. It could ran telnet for accessin ser2net for example. --- lavalab-gen.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lavalab-gen.py') diff --git a/lavalab-gen.py b/lavalab-gen.py index b7b4356..0e6408f 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -28,6 +28,9 @@ template_device = string.Template("""{% extends '${devicetype}.jinja2' %} template_device_conmux = string.Template(""" {% set connection_command = 'conmux-console ${board}' %} """) +template_device_connection_command = string.Template("""# +{% set connection_command = '${connection_command}' %} +""") template_device_pdu_generic = string.Template(""" {% set hard_reset_command = '${hard_reset_command}' %} {% set power_off_command = '${power_off_command}' %} @@ -95,6 +98,9 @@ def main(args): fp.write(line) fp.close() device_line += template_device_conmux.substitute(board=board_name) + elif b.has_key("connection_command"): + connection_command = b["connection_command"] + device_line += template_device_connection_command.substitute(connection_command=connection_command) if b.has_key("fastboot_serial_number"): fserial = b["fastboot_serial_number"] device_line += "{%% set fastboot_serial_number = '%s' %%}" % fserial -- cgit 1.2.3-korg