'Find the path for InfluxDB.'

def find_influxd_path(self):

    influxdb_bin_path = os.environ.get(u'INFLUXDB_PYTHON_INFLUXD_PATH', None)
    if (influxdb_bin_path is None):
        influxdb_bin_path = distutils.spawn.find_executable(u'influxd')
        if (not influxdb_bin_path):
            try:
                influxdb_bin_path = subprocess.check_output([u'which', u'influxd']).strip()
            except subprocess.CalledProcessError:
                influxdb_bin_path = u'/opt/influxdb/influxd'
    if (not os.path.isfile(influxdb_bin_path)):
        raise unittest.SkipTest(u'Could    not    find    influxd    binary')
    version = subprocess.check_output([influxdb_bin_path, u'version'])
    print((u'InfluxDB    version:    %s' % version), file=sys.stderr)
    return influxdb_bin_path
