diff options
author | Kevin Hilman <khilman@baylibre.com> | 2021-01-04 08:36:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 08:36:41 -0800 |
commit | 9b1f44982e0091d5e620d225b59ad5a4c0fc5aeb (patch) | |
tree | 075621a294fd16b0e177529af3073427aedd3c64 /lava-slave/scripts/getworkertoken.py | |
parent | 7151f9ebc95495b0eb3beb6ee556737a5c6ed163 (diff) | |
parent | 7739038c60331b71add3d5183412e50a38bfa2f3 (diff) |
Merge pull request #130 from montjoie/support-2020.09plus
Support 2020.09plus
Diffstat (limited to 'lava-slave/scripts/getworkertoken.py')
-rw-r--r-- | lava-slave/scripts/getworkertoken.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lava-slave/scripts/getworkertoken.py b/lava-slave/scripts/getworkertoken.py new file mode 100644 index 0000000..f538960 --- /dev/null +++ b/lava-slave/scripts/getworkertoken.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import xmlrpc.client +import sys + +if len(sys.argv) < 3: + print("ERROR: Usage: %s URI workername" % sys.argv[0]) + sys.exit(1) + +server = xmlrpc.client.ServerProxy("%s" % sys.argv[1]) +wdet = server.scheduler.workers.show("%s" % sys.argv[2]) +if "token" in wdet: + print(wdet["token"]) + sys.exit(0) +sys.exit(1) |