Beremiz_service.py
branchnevow_service_rework
changeset 2211 46447d99e5f9
parent 2210 81949104291d
parent 2205 4c74218b42e1
child 2212 cf1718962567
equal deleted inserted replaced
2210:81949104291d 2211:46447d99e5f9
   621         except Exception:
   621         except Exception:
   622             LogMessageAndException(_("Nevow Web service failed. "))
   622             LogMessageAndException(_("Nevow Web service failed. "))
   623 
   623 
   624     if wampconf is not None:
   624     if wampconf is not None:
   625         try:
   625         try:
   626             _wampconf = WC.LoadWampClientConf(wampconf)
   626             WC.SetServer(pyroserver, wampconf, wampsecret)
       
   627             _wampconf = WC.GetConfiguration()
   627             if _wampconf:
   628             if _wampconf:
   628                 if _wampconf["url"]:  # TODO : test more ?
   629                 if _wampconf.get("url", False) and _wampconf.get("active", False):  # TODO : test more ?
   629                     WC.RegisterWampClient(wampconf, wampsecret)
   630                     WC.RegisterWampClient()
   630                     pyruntimevars["wampsession"] = WC.GetSession
       
   631                     WC.SetServer(pyroserver)
       
   632                 else:
   631                 else:
   633                     raise Exception(_("WAMP config is incomplete."))
   632                     raise Exception(_("WAMP config is incomplete or active is false."))
   634             else:
   633             else:
   635                 raise Exception(_("WAMP config is missing."))
   634                 raise Exception(_("WAMP config is missing."))
   636         except Exception:
   635         except Exception:
   637             LogMessageAndException(_("WAMP client startup failed. "))
   636             LogMessageAndException(_("WAMP client startup failed. "))
   638 
   637