- if self.args.mode is not None and (
- self.args.mount_by_id or
- self.args.mount_by_pdh or
- self.args.mount_by_tag or
- self.args.mount_home or
- self.args.mount_shared or
- self.args.mount_tmp or
- self.args.mount_collection):
- sys.exit("Cannot combine '{}' mode with custom --mount-* options.".
- format(self.args.mode))
+ if self.args.collection is not None:
+ # Set up the request handler with the collection at the root
+ self.args.mode = 'collection'
+ dir_class = CollectionDirectory
+ dir_args.append(self.args.collection)
+ elif self.args.project is not None:
+ self.args.mode = 'project'
+ dir_class = ProjectDirectory
+ dir_args.append(
+ self.api.groups().get(uuid=self.args.project).execute(
+ num_retries=self.args.retries))
+
+ if (self.args.mount_by_id or
+ self.args.mount_by_pdh or
+ self.args.mount_by_tag or
+ self.args.mount_home or
+ self.args.mount_shared or
+ self.args.mount_tmp):
+ if self.args.mode is not None:
+ sys.exit(
+ "Cannot combine '{}' mode with custom --mount-* options.".
+ format(self.args.mode))
+ elif self.args.mode is None:
+ # If no --mount-custom or custom mount args, --all is the default
+ self.args.mode = 'all'