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

remove webservice changes

parent 70d12cd4
No related branches found
No related tags found
1 merge request!324karabo_da to list, jungfrau parallel dark, update conf
......@@ -8,7 +8,6 @@ import logging
import os
import sqlite3
import subprocess
import traceback
import urllib.parse
from datetime import datetime
......@@ -169,11 +168,8 @@ async def change_config(socket, config, updated_config, instrument, cycle,
defconf = yaml.load(f.read(), Loader=yaml.FullLoader)
subconf = {}
for action, instruments in defconf.items():
subconf[action] = {}
if action != "data-mapping":
subconf[action][instrument] = instruments[instrument]
else:
subconf[action][instrument] = instruments[karabo_id]
subconf[action]= {}
subconf[action][instrument] = instruments[instrument]
with open(fpath, "w") as wf:
wf.write(yaml.dump(subconf, default_flow_style=False))
new_conf = None
......@@ -575,16 +571,16 @@ async def server_runner(config, mode):
if action in ['update_conf']:
updated_config = None
try:
sase, karabo_id, instrument, cycle, proposal, config_yaml, apply = payload # noqa
sase, instrument, cycle, proposal, config_yaml, apply = payload # noqa
updated_config = json.loads(config_yaml)
await change_config(socket, config['config-repo'],
updated_config, karab_id, instrument,
cycle, proposal, apply.upper()=="TRUE")
updated_config, instrument, cycle,
proposal, apply.upper()=="TRUE")
except Exception as e:
e = str(e)
err_msg = f"Failure applying config for {proposal}:" + \
f" {str(e)}: {updated_config}"
f" {e}: {updated_config}"
logging.error(err_msg)
logging.error(f"Unexpected error: {traceback.format_exc()}")
socket.send(yaml.dump(err_msg, default_flow_style=False).encode())
if action in ['dark', 'correct']:
......
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