Exemplo n.º 1
0
    def __init__(self):
        BaseClient.__init__(
                self, 'Guild Client')

        self.top_gg = DBLClient(
                self,
                getenv('TOKEN_TOP_GG'),
                webhook_path='/dblwebhook',
                webhook_auth='password',
                webhook_port=5000)

        self.bots_on_discord = BotsOnDiscordHandler(
                self, getenv('TOKEN_BOTS_ON_DISCORD'))

        self.discord_bots = DiscordBotsHandler(
                self, getenv('TOKEN_DISCORD_BOTS'))
Exemplo n.º 2
0
    def __init__(self, name, conf, os_auth_info):
        BaseClient.__init__(self, name, conf, os_auth_info)
        self.handle = client.Client(
                           os_auth_info["username"],
                           os_auth_info["password"],
                           os_auth_info["tenant_name"],
                           os_auth_info["auth_url"],
                           insecure=True,
                           service_type="compute")

        # Maybe the client doesn't prefer ssh route
        self.ssh_info = conf.get("ssh", None)

        servers = []
        try:
            servers.extend(self.handle.servers.list())
        except NotFound:
            logging.warn("No servers present for client %s" % name)

        self.pattern = re.compile("^" + os_auth_info["username"] + "-[0-9]{3}")
        for inst in servers:
            if not self.pattern.match(inst.name):
                continue
            instance = Instance(inst, self.ssh_info)
            instanceId = instance.get_id()

            self.id2inst[instanceId] = instance

            vols = []
            try:
                vols.extend(self.handle.volumes.get_server_volumes(instanceId))
            except NotFound:
                logging.warn("No volume attached for instance %s(%s)" % (instance.get_name(), instance.get_id()))

            volumes = self.id2vols[instanceId] = []
            for vol in vols:
                volumes.append(Volume(instance, vol))
Exemplo n.º 3
0
 def __init__(self):
     BaseClient.__init__(self, url_prefix=RODIMUS_SERVICE_URL, version=RODIMUS_SERVICE_VERSION)
Exemplo n.º 4
0
 def __init__(self):
     BaseClient.__init__(self, url_prefix=TELETRAAN_SERVICE_URL, version=TELETRAAN_SERVICE_VERSION)
Exemplo n.º 5
0
    def __init__(self):
        BaseClient.__init__(self, 'Message Client')

        self.mention = None
Exemplo n.º 6
0
 def __init__(self):
     BaseClient.__init__(self,
                         url_prefix=RODIMUS_SERVICE_URL,
                         version=RODIMUS_SERVICE_VERSION)
Exemplo n.º 7
0
 def __init__(self):
     BaseClient.__init__(self,
                         url_prefix=TELETRAAN_SERVICE_URL,
                         version=TELETRAAN_SERVICE_VERSION)