Beispiel #1
0
def main(action):
    if not action == "foreground":
        os.setgid(grp.getgrnam('nogroup')[2])
        os.setuid(pwd.getpwnam(config.get("server", "user"))[2])

    debug(config.getboolean("server", "debug"))
    port = config.getint("server", "port")
    bind_addr = config.get("server", "bind_addr")
    set_logger()
    LOG.info("Starting Simplestack server")
    run(host=bind_addr, port=port, server="gevent")
Beispiel #2
0
def main(action):
    if not action == "foreground":
        os.setgid(grp.getgrnam('nogroup')[2])
        os.setuid(pwd.getpwnam(config.get("server", "user"))[2])

    debug(config.getboolean("server", "debug"))
    port = config.getint("server", "port")
    bind_addr = config.get("server", "bind_addr")
    set_logger()
    LOG.info("Starting Simplestack server")
    run(host=bind_addr, port=port, server="gevent")
Beispiel #3
0
    def libvirt_connection_path(self):
        proto = config.get("libvirt", "transport")

        if proto == "ssh":
            keyfile = config.get("libvirt", "ssh_keyfile")

            if os.path.exists(keyfile):
                params = "keyfile=%s" % keyfile
            else:
                raise SSHKeyNotFound
        else:
            params = "no_verify=1"

        conn_str = "qemu+%(proto)s://%(username)s@%(server)s/system?%(params)s"

        return (conn_str % {
            "params": params,
            "proto": proto,
            "server": self.poolinfo.get("api_server"),
            "username": self.poolinfo.get("username"),
        })
Beispiel #4
0
    def libvirt_connection_path(self):
        proto = config.get("libvirt", "transport")

        if proto == "ssh":
            keyfile = config.get("libvirt", "ssh_keyfile")

            if os.path.exists(keyfile):
                params = "keyfile=%s" % keyfile
            else:
                raise SSHKeyNotFound
        else:
            params = "no_verify=1"

        conn_str = "qemu+%(proto)s://%(username)s@%(server)s/system?%(params)s"

        return(conn_str % {
            "params": params,
            "proto" : proto,
            "server": self.poolinfo.get("api_server"),
            "username": self.poolinfo.get("username"),
        })