TANGO_HOST multi db server #929
Description
From sardana created by taurel: sardana-org/sardana#1151
At the ESRF machine side, our control system is configured with two running Tango database
servers. Therefore, the TANGO_HOST environment variable is set to host:port1,host:port2
(This is a relatively unknown but old Tango feature). We are now using sardana 2.7.0 with taurus 4.5.1.
The MacroServer refuses to start with such a TANGO_HOST env. variable with error message:
python MacroServer.py ebs_psMainThread WARNING 2019-06-19 14:47:20,878 TaurusRootLogger: /operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/pool/pooldefs.py:34: DeprecationWarning: taurus.external.enum is deprecated since 4.3.2. Use enum (enum34 module) instead
from taurus.external.enum import IntEnum
MainThread CRITICAL 2019-06-19 14:47:21,275 TaurusRootLogger: Server exited with DevFailed
Traceback (most recent call last):
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/tango/core/util.py", line 1175, in run_tango_server
util.server_init()
DevFailed: DevFailed[
DevError[
desc = TypeError: 'NoneType' object is not iterable
origin = File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/tango/device_class.py", line 571, in __DeviceClass__device_factory
device = self._new_device(deviceImplClass, klass, dev_name)
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/tango/device_class.py", line 550, in __DeviceClass__new_device
return klass(dev_class, dev_name)
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/tango/macroserver/MacroServer.py", line 51, in init
SardanaDevice.init(self, cl, name)
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/tango/core/SardanaDevice.py", line 78, in init
self.init(name)
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/tango/macroserver/MacroServer.py", line 59, in init
self._macro_server = ms = MS(self.get_full_name(), self.alias)
File "/operation/common/miniconda3/envs/py27/lib/python2.7/site-packages/sardana/tango/core/SardanaDevice.py", line 150, in get_full_name
db_name, _, _ = TangoAuthorityNameValidator().getNames(db_name)
reason = PyDs_PythonError
severity = ERR]
]
As printed by the stacktrace, the problem is around line 150 of sardana/tango/core/SardanaDevice.py (method get_full_name) where the value of the TANGO_HOST is used
to build a device name FQDN.
There is a simple workaround which is to reset the TANGO_HOST env. variable to its
simple form
Cheers and good luck