+ log_handler = logging.StreamHandler()
+
+ if base_logger is None:
+ base_logger = logging.getLogger()
+ else:
+ base_logger.removeHandler(arvados.log_handler)
+ base_logger.addHandler(log_handler)
+
+ if args.debug:
+ base_logger.setLevel(logging.DEBUG)
+ logger.debug("arv-mount debugging enabled")
+
+ try:
+ # Create the request handler
+ operations = Operations(os.getuid(), os.getgid())
+ api = arvados.api('v1')
+
+ if args.groups:
+ e = operations.inodes.add_entry(GroupsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+ elif args.tags:
+ e = operations.inodes.add_entry(TagsDirectory(llfuse.ROOT_INODE, operations.inodes, api))
+ elif args.collection != None:
+ # Set up the request handler with the collection at the root
+ e = operations.inodes.add_entry(CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, args.collection))
+ else:
+ # Set up the request handler with the 'magic directory' at the root
+ operations.inodes.add_entry(MagicDirectory(llfuse.ROOT_INODE, operations.inodes))
+ except Exception:
+ logger.exception("arv-mount: exception during API setup")
+ exit(1)