From 2d7a167ffe0cd2a2db5164a63c16c13464376cff Mon Sep 17 00:00:00 2001
From: Fabian Scheler <Fabian.Scheler@siemens.com>
Date: Tue, 14 Jul 2020 13:24:12 +0200
Subject: [Fix] Ensure proper filename of public master key

Currently, the public master key is references as $LAVA_MASTER.key in
e.g. scripts/setup.sh. If the key is named master.key it is copied to
$LAVA_MASTER.key by scripts/setup.sh. However, no nameing convention for the
public master key provided to lavalab-gen.py is documented, so the worker simply
will not start if the key is stored as e.g. master-public.key. Running into such
error scenarios could simply be prevented by copying the public master key to an
appropriatly named file in lavalab-gen.py. This is done here.
---
 lavalab-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lavalab-gen.py b/lavalab-gen.py
index f7cd66d..87b0cd5 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -501,7 +501,7 @@ def main():
                 if "zmq_auth_key" in worker:
                     shutil.copy(worker["zmq_auth_key"], "%s/zmq_auth/" % workerdir)
                     shutil.copy(worker["zmq_auth_key_secret"], "%s/zmq_auth/" % workerdir)
-                    shutil.copy(worker["zmq_auth_master_key"], "%s/zmq_auth/" % workerdir)
+                    shutil.copy(worker["zmq_auth_master_key"], "%s/zmq_auth/%s.key" % (workerdir,remote_master))
         for fm in masters:
             if fm["name"].lower() == remote_master.lower():
                 slave_master = fm
-- 
cgit