Beremiz_service.py
branchnevow_service_rework
changeset 2211 46447d99e5f9
parent 2210 81949104291d
parent 2205 4c74218b42e1
child 2212 cf1718962567
--- a/Beremiz_service.py	Wed Jul 04 14:10:03 2018 +0200
+++ b/Beremiz_service.py	Wed Jul 04 14:17:00 2018 +0200
@@ -623,14 +623,13 @@
 
     if wampconf is not None:
         try:
-            _wampconf = WC.LoadWampClientConf(wampconf)
+            WC.SetServer(pyroserver, wampconf, wampsecret)
+            _wampconf = WC.GetConfiguration()
             if _wampconf:
-                if _wampconf["url"]:  # TODO : test more ?
-                    WC.RegisterWampClient(wampconf, wampsecret)
-                    pyruntimevars["wampsession"] = WC.GetSession
-                    WC.SetServer(pyroserver)
+                if _wampconf.get("url", False) and _wampconf.get("active", False):  # TODO : test more ?
+                    WC.RegisterWampClient()
                 else:
-                    raise Exception(_("WAMP config is incomplete."))
+                    raise Exception(_("WAMP config is incomplete or active is false."))
             else:
                 raise Exception(_("WAMP config is missing."))
         except Exception: