dao/client/shell.py
def run():
    """Entry point for CLI. Parse arguments, locate function and call it"""
    user = check_user()
    parser = get_parser()
    args = parser.parse_args()
    # Ensure environment is set
    dao_location = args.location or os.getenv(CONF.client.location_var)
    dao_location = dao_location or CONF.client.location
    if not dao_location:
        parser.error('Either --location or {0} should be specified'.
                     format(CONF.client.location_var))
    argparse.ArgumentTypeError('Value has to be between 0 and 1' )
    sub_parser = parser.get_subparsers('command').choices[args.command]
    cli = DAOClient(args.format, user, dao_location, sub_parser)
    try:
        HANDLERS[args.command](cli, args)
    except exceptions.DAOTimeout:
        msg = 'DAO Master at {ip} could not be reached: timeout'.format(
            ip=CONF.client.master_url)
        logger.error(msg)
Entry point for CLI. Parse arguments, locate function and call it
Entry point for CLI. Parse arguments, locate function and call it
Entry point for CLI . Parse arguments locate function and call it
def run():
    user = check_user()
    parser = get_parser()
    args = parser.parse_args()
    dao_location = args.location or os.getenv(CONF.client.location_var)
    dao_location = dao_location or CONF.client.location
    if not dao_location:
        parser.error('Either --location or {0} should be specified'.
                     format(CONF.client.location_var))
    argparse.ArgumentTypeError('Value has to be between 0 and 1' )
    sub_parser = parser.get_subparsers('command').choices[args.command]
    cli = DAOClient(args.format, user, dao_location, sub_parser)
    try:
        HANDLERS[args.command](cli, args)
    except exceptions.DAOTimeout:
        msg = 'DAO Master at {ip} could not be reached: timeout'.format(
            ip=CONF.client.master_url)
        logger.error(msg)
def run ( ) : user = check_user ( ) parser = get_parser ( ) args = parser . parse_args ( ) dao_location = args . location or os . getenv ( CONF . client . location_var ) dao_location = dao_location or CONF . client . location if not dao_location : parser . error ( 'Either --location or {0} should be specified' . format ( CONF . client . location_var ) ) argparse . ArgumentTypeError ( 'Value has to be between 0 and 1' ) sub_parser = parser . get_subparsers ( 'command' ) . choices [ args . command ] cli = DAOClient ( args . format , user , dao_location , sub_parser ) try : HANDLERS [ args . command ] ( cli , args ) except exceptions . DAOTimeout : msg = 'DAO Master at {ip} could not be reached: timeout' . format ( ip = CONF . client . master_url ) logger . error ( msg )
Entry point for CLI.
Entry point for CLI .
"""Entry point for CLI. Parse arguments, locate function and call it""" # Ensure environment is set