diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2019-09-30 14:46:51 +0200 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2019-10-04 08:48:28 +0200 |
commit | 4760b0d2372ca68275296e86aa6cfc1f731cd543 (patch) | |
tree | 02c8c3541667d7d15071ca8e8942954ddab66440 | |
parent | 04e7644a48857c2bf236b687d1d30855131769fa (diff) |
lavalab-gen: Permit to have tags per slave
This patchs permits to have tags per slave.
All tags set on a slave will be added to each of its devices.
-rw-r--r-- | README.md | 3 | ||||
-rwxr-xr-x | lavalab-gen.py | 8 |
2 files changed, 10 insertions, 1 deletions
@@ -291,6 +291,9 @@ slaves: env: - line1 A list of line to set as environment (See /etc/lava-server/env.yaml for examples) - line2 + tags: (optional) List of tag to set on all devices attached to this slave + - tag1 + - tag2 devices: A list of devices which need UDEV rules - name: The name of the device vendorid: The VID of the UART (Formated as 0xXXXX) diff --git a/lavalab-gen.py b/lavalab-gen.py index 539d80c..d37eb90 100755 --- a/lavalab-gen.py +++ b/lavalab-gen.py @@ -364,7 +364,7 @@ def main(): else: slaves = workers["slaves"] for slave in slaves: - keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator", "use_tap", "host_healthcheck", "use_tftp", "use_nbd", "use_overlay_server" ] + keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator", "use_tap", "host_healthcheck", "use_tftp", "use_nbd", "use_overlay_server", "tags" ] for keyword in slave: if not keyword in keywords_slaves: print("WARNING: unknown keyword %s" % keyword) @@ -702,6 +702,12 @@ def main(): for tag in board["tags"]: ftag.write("%s\n" % tag) ftag.close() + if "tags" in slave: + tagdir = "%s/tags/" % workerdir + ftag = open("%s/%s" % (tagdir, board_name), 'a') + for tag in slave["tags"]: + ftag.write("%s\n" % tag) + ftag.close() if "aliases" in board: aliases_dir = "%s/aliases/" % workerdir falias = open("%s/%s" % (aliases_dir, board["type"]), 'a') |