summaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorkhilman <khilman@users.noreply.github.com>2018-07-27 08:22:10 -0500
committerGitHub <noreply@github.com>2018-07-27 08:22:10 -0500
commit61a473fb56ef7418314385df7b72cd58e40a2ff2 (patch)
tree6502b5650c12f630bb6aada9448ca4238b556148 /lavalab-gen.py
parentd733f2d4280959fed968d1589580f46460ecba27 (diff)
parentb19b71ab89761e801c27038f093d76655efabfbf (diff)
Merge pull request #36 from montjoie/miscfix_07_2018b
Miscfix 07 2018b
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index f7f06f3..2d21fe7 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -87,7 +87,7 @@ def main():
sys.exit(1)
masters = workers["masters"]
for master in masters:
- keywords_master = [ "name", "type", "host", "users", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret" ]
+ keywords_master = [ "name", "type", "host", "users", "tokens", "webadmin_https", "persistent_db", "zmq_auth", "zmq_auth_key", "zmq_auth_key_secret", "http_fqdn" ]
for keyword in master:
if not keyword in keywords_master:
print("WARNING: unknown keyword %s" % keyword)
@@ -138,12 +138,19 @@ def main():
else:
cookie_secure = "false"
session_cookie_secure = "false"
+ if "http_fqdn" in worker:
+ lava_http_fqdn = worker["http_fqdn"]
+ else:
+ lava_http_fqdn = "example.com"
+ f_fqdn = open("%s/lava_http_fqdn" % workerdir, 'w')
+ f_fqdn.write(lava_http_fqdn)
+ f_fqdn.close()
fsettings = open("%s/settings.conf" % workerdir, 'w')
fsettings.write(template_settings_conf.substitute(cookie_secure=cookie_secure, session_cookie_secure=session_cookie_secure))
fsettings.close()
master_use_zmq_auth = False
if "zmq_auth" in worker:
- master_use_zmq_auth = True
+ master_use_zmq_auth = worker["zmq_auth"]
if master_use_zmq_auth:
if "zmq_auth_key" in worker:
shutil.copy(worker["zmq_auth_key"], "%s/zmq_auth/" % workerdir)
@@ -153,7 +160,7 @@ def main():
need_zmq_auth_gen = True
if "users" in worker:
for user in worker["users"]:
- keywords_users = [ "name", "staff", "superuser", "password", "token" ]
+ keywords_users = [ "name", "staff", "superuser", "password", "token", "email" ]
for keyword in user:
if not keyword in keywords_users:
print("WARNING: unknown keyword %s" % keyword)
@@ -166,6 +173,9 @@ def main():
password = user["password"]
ftok.write("PASSWORD=" + password + "\n")
# libyaml convert yes/no to true/false...
+ if "email" in user:
+ email = user["email"]
+ ftok.write("EMAIL=" + email + "\n")
if "staff" in user:
value = user["staff"]
if value is True:
@@ -278,6 +288,8 @@ def main():
if fuser["name"] == remote_user:
remote_token = fuser["token"]
if "zmq_auth" in fm:
+ master_use_zmq_auth = fm["zmq_auth"]
+ if master_use_zmq_auth:
if "zmq_auth_key" in fm:
shutil.copy(fm["zmq_auth_key"], "%s/zmq_auth/" % workerdir)
if "zmq_auth_key" in worker: