# HG changeset patch # User Edouard Tisserant # Date 1531380909 -7200 # Node ID 8ac0f1af5589ce582bae79ff9260d1e91c5a0c0f # Parent e03f7649bfb347ba0cdc5bcf9dab6bffd53a4143 WAMP : complains about failure to start WAMP only if it was successfully imported. diff -r e03f7649bfb3 -r 8ac0f1af5589 Beremiz_service.py --- 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()