From 8171032bcf363cbda9cb702c8386fc459811d817 Mon Sep 17 00:00:00 2001
From: Karim Ahmed <karim.ahmed@xfel.eu>
Date: Tue, 29 Oct 2019 09:27:56 +0100
Subject: [PATCH] a fix from testing on prod for no-bool

---
 webservice/update_config.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/webservice/update_config.py b/webservice/update_config.py
index b732c06e4..5612a0bb3 100644
--- a/webservice/update_config.py
+++ b/webservice/update_config.py
@@ -1,4 +1,5 @@
 import argparse
+import copy
 import json
 import sys
 
@@ -35,9 +36,6 @@ if "--help" in sys.argv:
     sys.argv.remove("--help")
     add_help = True
 
-# Save available_options before adding bool keys with "no-".
-prev_available_opt = available_options
-
 for det, val in available_options.items():
     bool_keys = []
     for k, v in val.items():
@@ -53,7 +51,6 @@ detector = args["detector"]
 if detector is not None:
     for option, typ in available_options[detector].items():
         if typ == list:
-            print(typ)
             nargs = '+'
         else:
             nargs = None
@@ -83,7 +80,7 @@ for key, value in args.items():
                 value[value.index(v)] = ''.join(v)
 
         if 'no-' in key and isinstance(value, bool):
-            if key not in prev_available_opt[detector].keys():
+            if key not in bool_keys:
                 new_conf[task][instrument][detector][key.replace('no-','')] = False
             # avoid saving the "no-"key into the updated config
             continue
-- 
GitLab