Example #1
0
def get_args():
    parser = ArgumentParser()

    parser.add_argument('-i', '--ip', required=True)
    parser.add_argument('-p', '--port', required=True)
    parser.add_argument('--https', action='store_true')

    args = parser.parse_args()

    init_properties(10, 10)
    return [args.ip, args.port, 'https' if args.https else 'http']
Example #2
0
def get_args():
    parser = ArgumentParser()

    parser.add_argument('-i', '--ip', required=True)
    parser.add_argument('-p', '--port', required=True)
    parser.add_argument('--https', action='store_true')
    path = os.path.dirname(__file__)
    parser.add_argument('--conf',
                        default=os.path.join(path, 'data', 'users.json'))

    args = parser.parse_args()

    init_properties(10, 10)
    return [args.ip, args.port, 'https' if args.https else 'http', args.conf]
Example #3
0
def get_args():
    print('Number of arguments:', len(sys.argv), 'arguments.')

    conf_path, scheme, be_host, be_port, admin_user, update_version, debug = parse_param(
    )
    defaults = load_be_config(conf_path)

    # Use defaults if param not provided by the user
    if be_host is None:
        be_host = defaults["beHost"]
    if be_port is None:
        be_port = defaults["bePort"]
    if admin_user is None:
        admin_user = defaults["adminUser"]

    print('scheme =', scheme, ',be host =', be_host, ', be port =', be_port,
          ', user ='******', debug =', debug, ', update_version =',
          update_version)

    init_properties(defaults["retryTime"], defaults["retryAttempt"],
                    defaults["resourceLen"])
    return scheme, be_host, be_port, admin_user, update_version, debug