Skip to content
Snippets Groups Projects
Commit ca652dee authored by Michi Hostettler's avatar Michi Hostettler :coffee:
Browse files

raise if re-initialized with a different server (guarding static setup in Java)

parent a918794f
No related branches found
No related tags found
No related merge requests found
Pipeline #2303286 passed
__version__ = "0.2.4"
__version__ = "0.2.5"
__cmmnbuild_deps__ = [
{"product": "log4j", "groupId": "log4j"},
......
......@@ -176,7 +176,12 @@ class LSAClient(object):
self._CernAccelerator = self._cern.accsoft.commons.domain.CernAccelerator
# starting services
self._System.setProperty("lsa.server", server)
configuredServer = self._System.getProperty("lsa.server")
if configuredServer is None:
self._System.setProperty("lsa.server", server)
elif configuredServer != server:
raise RuntimeError("LSA is already configured to connect to server '%s'. "
"Please restart python to change server to '%s'." % (configuredServer, server))
self._contextService = self._ServiceLocator.getService(self._ContextService)
self._trimService = self._ServiceLocator.getService(self._TrimService)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment