Exemple #1
0
def init_client():
    config = configparser.ConfigParser()
    config.read(CLIENT_CONFIG_FILE)
    config.set('mds', 'mds_port', MDS_PORT)

    client = Client(config)
    return client
Exemple #2
0
def init():
    """init client"""
    # handle command line argument
    parser = argparse.ArgumentParser()
    parser.add_argument('-c', '--config',
                        metavar='CONFIG_FILE',
                        help='clientconfig file',
                        default='../conf/client.cfg')
    args = parser.parse_args()
    config_file = args.config

    # get config options
    config = configparser.ConfigParser()
    config.read(config_file)

    # get the client
    client = Client(config, test=True)
    return client