def __init__(self, root=None, cmd=None, cfg_file=None, port=None, admin='root', password=None, foreground=True):
        """
        root:  Root directory of InfluxDB service. If set, it will not
               be removed. If not set, data and log files will be removed.
        cmd: The `influxdb` command to run if `influxdb` is not in $PATH.
        Usage of this class:
            with InfluxDBServer(root="/opt/influxdb/shared") as ts:
                ts = YourInfluxDBClient(ts.uri())
            # influxdb terminated here when context exits
        """
        if cmd is None:
            cmd = str(clom.which('influxdb').shell())
        self._cmd = cmd

        self._foreground = foreground

        self._use_tmp_dir = False
        self._root = root
        self._cfg_file = cfg_file
        self._host = None
        self._port = port
        self._admin = admin
        self._password = password
        self._ts_pid = None
        self._owner_pid = os.getpid()
Exemple #2
0
def which(command):
    with settings(hide('everything'), warn_only=True):
        return run(clom.which(command)).succeeded
Exemple #3
0
def which(command):
    with settings(hide("everything"), warn_only=True):
        return run(clom.which(command)).succeeded
Exemple #4
0
def which(command):
    """
    Get path to a command on the provisioning box.
    """
    with settings(hide('everything'), warn_only=True):
        return str(run(clom.which(command)))