예제 #1
0
def figure_out_postgres_data_dir(db_connection, conf):
    data_dir = conf['postgres']['data_dir']
    if not data_dir:
        db_version = get_major_version(db_connection)
        data_dir = "/var/lib/postgresql/{0}/main".format(db_version)
    if not os.path.isdir(data_dir):
        LOG.debug("data directory '{}' doesn't exist", data_dir)
        data_dir = None
    else:
        LOG.debug('using postgres data directory: {}', data_dir)
    return data_dir
예제 #2
0
def figure_out_postgres_data_dir(db_connection, conf):
    data_dir = conf['postgres']['data_dir']
    if not data_dir:
        db_version = get_major_version(db_connection)
        data_dir = "/var/lib/postgresql/{0}/main".format(db_version)
    if not os.path.isdir(data_dir):
        LOG.debug("data directory '{}' doesn't exist", data_dir)
        data_dir = None
    else:
        LOG.debug('using postgres data directory: {}', data_dir)
    return data_dir