+ self.client.container = dst_cont
+ try:
+ dstobj = self.client.get_object_info(dst_path)
+ except ClientError as trgerr:
+ if trgerr.status in (404,):
+ if src_N:
+ raiseCLIError(
+ 'Cannot merge multiple paths to path %s' % dst_path,
+ details=[
+ 'Try to use / or a directory as destination',
+ 'or create the destination dir (/store mkdir)',
+ 'or use a single object as source'])
+ elif trgerr.status not in (204,):
+ raise
+ else:
+ if self._is_dir(dstobj):
+ add_prefix = '%s/%s' % (dst_path.strip('/'), add_prefix)
+ elif src_N:
+ raiseCLIError(
+ 'Cannot merge multiple paths to path' % dst_path,
+ details=[
+ 'Try to use / or a directory as destination',
+ 'or create the destination dir (/store mkdir)',
+ 'or use a single object as source'])
+
+ self.client.container = self.container
+ if src_N:
+ (method, kwargs) = src_iter
+ for obj in method(**kwargs):
+ name = obj['name']
+ if name.endswith(self['suffix']):
+ yield (name, self._get_new_object(name, add_prefix))
+ elif src_iter['name'].endswith(self['suffix']):
+ name = src_iter['name']
+ yield (name, self._get_new_object(dst_path or name, add_prefix))
+ else:
+ raiseCLIError('Source path %s conflicts with suffix %s' % (
+ src_iter['name'],
+ self['suffix']))