示例#1
0
def msghub_broadcast(channel, msg):
    """
    Shared function for broadcasting a message via the msghub service.
    """
    from websocket import create_connection
    url = catoconfig.get_url("msghub", "localhost")
    uri = "%s/pub/%s" % (url, channel)
    try:
        ws = create_connection(uri)
    except Exception as e:
        raise Exception("Error attempting to connect to message hub at address %s, %s" 
                        % (url, e))
    ws.send(msg)
    ws.close()
示例#2
0
    def wmGetConfig(self):
        # we are adding some Maestro specific stuff to the general config
        cfg = catoconfig.SAFECONFIG

        cfg["csk_ui_url"] = catoconfig.get_url("csk_ui", web.ctx.host.split(":")[0])
        cfg["admin_ui_url"] = catoconfig.get_url("admin_ui", web.ctx.host.split(":")[0])
        cfg["cd_ui_url"] = catoconfig.get_url("cd_ui", web.ctx.host.split(":")[0])
        cfg["user_ui_url"] = catoconfig.get_url("user_ui", web.ctx.host.split(":")[0])
        cfg["dash_api_url"] = catoconfig.get_url("dash_api", web.ctx.host.split(":")[0])
        cfg["msghub_url"] = catoconfig.get_url("msghub", web.ctx.host.split(":")[0])

        return catocommon.ObjectOutput.AsJSON(cfg)
示例#3
0
    def wmGetConfig(self):
        cfg = catoconfig.SAFECONFIG

        cfg["csk_ui_url"] = catoconfig.get_url("csk_ui", web.ctx.host.split(":")[0])
        return catocommon.ObjectOutput.AsJSON(cfg)