+ def _run(self, source_container___path, path_is_optional=False):
+ super(_source_destination_command, self)._run(
+ source_container___path,
+ path_is_optional)
+ self.dst_client = PithosClient(
+ base_url=self.client.base_url,
+ token=self.client.token,
+ account=self['destination_account'] or self.client.account)
+
+ @errors.generic.all
+ @errors.pithos.account
+ def _dest_container_path(self, dest_container_path):
+ if self['destination_container']:
+ self.dst_client.container = self['destination_container']
+ return (self['destination_container'], dest_container_path)
+ if dest_container_path:
+ dst = dest_container_path.split(':')
+ if len(dst) > 1:
+ try:
+ self.dst_client.container = dst[0]
+ self.dst_client.get_container_info(dst[0])
+ except ClientError as err:
+ if err.status in (404, 204):
+ raiseCLIError(
+ 'Destination container %s not found' % dst[0])
+ raise
+ else:
+ self.dst_client.container = dst[0]
+ return (dst[0], dst[1])
+ return(None, dst[0])
+ raiseCLIError('No destination container:path provided')
+