WAMP : complains about failure to start WAMP only if it was successfully imported.
--- a/Beremiz_service.py Wed Jul 11 14:32:19 2018 +0200
+++ b/Beremiz_service.py Thu Jul 12 09:35:09 2018 +0200
@@ -582,6 +582,7 @@
installThreadExcepthook()
+havewamp = False
if havetwisted:
if webport is not None:
@@ -595,6 +596,7 @@
try:
import runtime.WampClient as WC # pylint: disable=ungrouped-imports
WC.WorkingDir = WorkingDir
+ havewamp = True
except Exception:
LogMessageAndException(_("WAMP import failed :"))
@@ -613,12 +615,13 @@
except Exception:
LogMessageAndException(_("Nevow Web service failed. "))
- try:
- WC.SetServer(pyroserver)
- WC.RegisterWampClient(wampconf, wampsecret)
- WC.RegisterWebSettings(NS)
- except Exception:
- LogMessageAndException(_("WAMP client startup failed. "))
+ if havewamp:
+ try:
+ WC.SetServer(pyroserver)
+ WC.RegisterWampClient(wampconf, wampsecret)
+ WC.RegisterWebSettings(NS)
+ except Exception:
+ LogMessageAndException(_("WAMP client startup failed. "))
pyro_thread_started = Lock()
pyro_thread_started.acquire()