Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
8aa780b3
Commit
8aa780b3
authored
4 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
remove webservice changes
parent
70d12cd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!324
karabo_da to list, jungfrau parallel dark, update conf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/webservice.py
+7
-11
7 additions, 11 deletions
webservice/webservice.py
with
7 additions
and
11 deletions
webservice/webservice.py
+
7
−
11
View file @
8aa780b3
...
...
@@ -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
'
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment