Beremiz_service.py
branchnevow_service_rework
changeset 2222 8ac0f1af5589
parent 2221 e03f7649bfb3
child 2245 fe3394697b02
--- 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()