# Path: postgraas_server/configuration.py
# def get_user(config):
#     try:
#         server = config['metadb']['server']
#         username = '@'.join([config['metadb']['db_username'], server])
#     except KeyError:
#         username = config['metadb']['db_username']
#     return username
# 
# def get_password(config):
#     try:
#         password = config['metadb']['db_pwd'].decrypt()
#     except AttributeError:
#         password = config['metadb']['db_pwd']
#     return password


import contextlib
import json
import os
import psycopg2
        import postgraas_server.init_db
from psycopg2.sql import SQL
from postgraas_server.configuration import get_user, get_password
# coding=utf-8





CLUSTER_CONFIG = {
    "metadb": {
        "db_name": os.environ.get('PGDATABASE', 'postgres'),
        "db_username": os.environ.get('PGUSER', 'postgres'),
        "db_pwd": os.environ.get('PGPASSWORD', 'postgres'),
        "host": os.environ.get('PGHOST', 'localhost'),
        "port": os.environ.get('PGPORT', '5432'),
    }
}


@contextlib.contextmanager

# Path: postgraas_server/configuration.py
# def get_user(config):
#     try:
#         server = config['metadb']['server']
#         username = '@'.join([config['metadb']['db_username'], server])
#     except KeyError:
#         username = config['metadb']['db_username']
#     return username
# 
# def get_password(config):
#     try:
#         password = config['metadb']['db_pwd'].decrypt()
#     except AttributeError:
#         password = config['metadb']['db_pwd']
#     return password


# Path: tests/test_integration/test_init_db.py
import contextlib
import json
import os
import psycopg2
        import postgraas_server.init_db
from psycopg2.sql import SQL
from postgraas_server.configuration import get_user, get_password

# coding=utf-8





CLUSTER_CONFIG = {
    "metadb": {
        "db_name": os.environ.get('PGDATABASE', 'postgres'),
        "db_username": os.environ.get('PGUSER', 'postgres'),
        "db_pwd": os.environ.get('PGPASSWORD', 'postgres'),
        "host": os.environ.get('PGHOST', 'localhost'),
        "port": os.environ.get('PGPORT', '5432'),
    }
}


@contextlib.contextmanager

def _get_db_con():