Esempio n. 1
0
def main():
    parser = ArgumentParser()
    load_mount_parser_args(parser)

    args = parser.parse_args()

    option_string = args.opt[0] if args.opt else None

    try:
        mount(auth_storage_filepath=args.auth_storage_file, 
              mountpoint=args.mountpoint, debug=args.debug, 
              nothreads=args.debug, option_string=option_string)
    except (Exception) as e:
        message = ("Could not do mount [%s]: %s" % (e.__class__.__name__, str(e)))
        logging.exception(message)
        print(message)
Esempio n. 2
0
def main():
    parser = ArgumentParser()
    load_mount_parser_args(parser)

    args = parser.parse_args()

    option_string = args.opt[0] if args.opt else None

    try:
        mount(auth_storage_filepath=args.auth_storage_file,
              mountpoint=args.mountpoint,
              debug=args.debug,
              nothreads=args.debug,
              option_string=option_string)
    except (Exception) as e:
        message = ("Could not do mount [%s]: %s" %
                   (e.__class__.__name__, str(e)))
        logging.exception(message)
        print(message)
Esempio n. 3
0
    try:
        authorize = get_auth()
        authorize.step2_doexchange(authcode)

    except (Exception) as e:
        message = ("Authorization failed: %s" % (str(e)))

        logging.exception(message)
        print(message)
        exit()

    print("Authorization code recorded.")

# Mount the service.
elif 'mountpoint' in args and args.mountpoint:

    option_string = args.opt[0] if args.opt else None

    try:
        mount(auth_storage_filepath=args.auth_storage_file, 
              mountpoint=args.mountpoint, debug=args.debug, 
              nothreads=args.debug, option_string=option_string)
    except (Exception) as e:
        message = ("Mount failed: %s" % (str(e)))

        logging.exception(message)
        print(message)
        exit()


Esempio n. 4
0
    try:
        authorize = get_auth()
        authorize.step2_doexchange(authcode)

    except (Exception) as e:
        message = ("Authorization failed: %s" % (str(e)))

        logging.exception(message)
        print(message)
        exit()

    print("Authorization code recorded.")

# Mount the service.
elif 'mountpoint' in args and args.mountpoint:

    option_string = args.opt[0] if args.opt else None

    try:
        mount(auth_storage_filepath=args.auth_storage_file,
              mountpoint=args.mountpoint,
              debug=args.debug,
              nothreads=args.debug,
              option_string=option_string)
    except (Exception) as e:
        message = ("Mount failed: %s" % (str(e)))

        logging.exception(message)
        print(message)
        exit()