aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLUXEY Adrien <adrien.luxey@inria.fr>2021-01-19 17:16:58 +0100
committerLUXEY Adrien <adrien.luxey@inria.fr>2021-01-19 17:16:58 +0100
commit6e1940061ab6da8021cd9f38818657baa4be2d17 (patch)
tree1016773549ce493a32fb99a3e64bf0deab87fd98 /app
parent98280c8628bc1df6197a1a830808bcd8631101bf (diff)
downloadinfrastructure-6e1940061ab6da8021cd9f38818657baa4be2d17.tar.gz
infrastructure-6e1940061ab6da8021cd9f38818657baa4be2d17.zip
coturn retourne une erreur bien formatée face à un fichier vide (il pourrait renvoyer autre chose), plus bug nom de variable
Diffstat (limited to 'app')
-rwxr-xr-xapp/secretmgr.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/secretmgr.py b/app/secretmgr.py
index 6af6d13..950e5c0 100755
--- a/app/secretmgr.py
+++ b/app/secretmgr.py
@@ -103,6 +103,9 @@ class bcolors:
def read_secret(key, file_path):
lines = [l.strip() for l in open(file_path, "r")]
+ if len(lines) == 0:
+ print(bcolors.FAIL, "ERROR:", bcolors.ENDC, "Empty file in", file_path)
+ sys.exit(-1)
l0 = lines[0].split(" ")
stype = l0[0]
secret = {"type": stype, "key": key}
@@ -275,7 +278,7 @@ def gen_secrets_base(secrets, regen):
line = input().strip()
if line == ".":
break
- vals.append(line)
+ lines.append(line)
val = "\n".join(lines)
consul_server.kv.put(key, val)
print(bcolors.OKCYAN, "Value set.", bcolors.ENDC)