Bliss tango database emulation -> device set attribute broken (in a particular case?)
I've not quite figured out the trigger for this, as daiquiri can certainly write to attributes of tango device that exist in the bliss db. Maybe it's only triggered on first write of an attribute and old_properties
usually has a value?
If you try to set a property on the lima simulator bpm device you get:
Traceback (most recent call last):
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/bottle.py", line 868, in _handle
return route.call(**args)
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/bottle.py", line 1748, in wrapper
rv = callback(*a, **ka)
File "/bpm/webserver.py", line 329, in imgdisplay
self.cameras_running[camera][1].calibration = ([float(bottle.request.query.calib_x), float(bottle.request.query.calib_y)])
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/tango/device_proxy.py", line 366, in __DeviceProxy__setattr
return __set_attribute_value(self, name, value)
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/tango/device_proxy.py", line 302, in __set_attribute_value
return self.write_attribute(name, value)
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/tango/green.py", line 195, in greener
return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/tango/green.py", line 109, in run
return fn(*args, **kwargs)
File "/opt/conda/envs/bpm/lib/python3.9/site-packages/tango/device_proxy.py", line 1538, in __DeviceProxy__write_attribute
return self._write_attribute(*args, **kwargs)
PyTango.DevFailed: DevFailed[
DevError[
desc = TypeError: __init__() got an unexpected keyword argument 'key'
origin = Traceback (most recent call last):
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/databaseds/database.py", line 120, in wrapper
return f(self, *args, **kwargs)
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/server.py", line 1142, in cmd
return get_worker().execute(f, self, *args, **kwargs)
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/gevent_executor.py", line 182, in execute
return task.result()
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/gevent_executor.py", line 128, in result
six.reraise(*self.exception)
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/six.py", line 719, in reraise
raise value
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/gevent_executor.py", line 116, in run
self.value = self.func(*self.args, **self.kwargs)
File "/opt/conda/envs/daiquiri/lib/python3.7/site-packages/tango/databaseds/database.py", line 1010, in DbPutDeviceProperty
self.db.put_device_property(device_name, nb_properties, argin[2:])
File "/bliss/bliss/tango/db_access/beacon.py", line 30, in f
returnVal = funct(self, *args, **kwargs)
File "/bliss/bliss/tango/db_access/beacon.py", line 1102, in put_device_property
if old_properties is None:
TypeError: __init__() got an unexpected keyword argument 'key'
reason = PyDs_PythonError
severity = ERR]
DevError[
desc = Failed to execute command_inout on device sys/database/2, command DbPutDeviceProperty
origin = Connection::command_inout()
reason = API_CommandFailed
severity = ERR]
DevError[
desc = Failed to write_attribute on device id00/bpm/simulator1, attribute calibration
origin = DeviceProxy::write_attribute()
reason = API_AttributeFailed
severity = ERR]
Looking at https://gitlab.esrf.fr/bliss/bliss/-/blob/master/bliss/tango/db_access/beacon.py#L1102
properties = static.ConfigNode(device_node, key=["properties"])
ConfigNode does not accept a key
kw arg:
https://gitlab.esrf.fr/bliss/bliss/-/blob/c9a73209562845aa76e372318bdd7328a5cfa830/bliss/config/static.py#L321
Not sure what this was trying to achieve, but removing key=["properties"]
seems to make things work.