Skip to content
Snippets Groups Projects
Commit 8171032b authored by Karim Ahmed's avatar Karim Ahmed
Browse files

a fix from testing on prod for no-bool

parent 443ef7d1
No related branches found
No related tags found
1 merge request!193a fix from testing on prod for no-bool
import argparse import argparse
import copy
import json import json
import sys import sys
...@@ -35,9 +36,6 @@ if "--help" in sys.argv: ...@@ -35,9 +36,6 @@ if "--help" in sys.argv:
sys.argv.remove("--help") sys.argv.remove("--help")
add_help = True add_help = True
# Save available_options before adding bool keys with "no-".
prev_available_opt = available_options
for det, val in available_options.items(): for det, val in available_options.items():
bool_keys = [] bool_keys = []
for k, v in val.items(): for k, v in val.items():
...@@ -53,7 +51,6 @@ detector = args["detector"] ...@@ -53,7 +51,6 @@ detector = args["detector"]
if detector is not None: if detector is not None:
for option, typ in available_options[detector].items(): for option, typ in available_options[detector].items():
if typ == list: if typ == list:
print(typ)
nargs = '+' nargs = '+'
else: else:
nargs = None nargs = None
...@@ -83,7 +80,7 @@ for key, value in args.items(): ...@@ -83,7 +80,7 @@ for key, value in args.items():
value[value.index(v)] = ''.join(v) value[value.index(v)] = ''.join(v)
if 'no-' in key and isinstance(value, bool): 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 new_conf[task][instrument][detector][key.replace('no-','')] = False
# avoid saving the "no-"key into the updated config # avoid saving the "no-"key into the updated config
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment