Make sure to compare connection kwargs in storage copy fast-path
This ensures that if storage is on different hosts, then we use the slower but correct code path .
This commit is contained in:
parent
0ea600628b
commit
9979db0ce3
1 changed files with 18 additions and 2 deletions
|
@ -261,14 +261,30 @@ class _CloudStorage(BaseStorageV2):
|
|||
if (self.__class__ == destination.__class__ and
|
||||
self._access_key and self._secret_key and
|
||||
self._access_key == destination._access_key and
|
||||
self._secret_key == destination._secret_key):
|
||||
self._secret_key == destination._secret_key and
|
||||
self._connect_kwargs == destination._connect_kwargs):
|
||||
|
||||
# Initialize the cloud connection on the destination as well.
|
||||
destination._initialize_cloud_conn()
|
||||
|
||||
# Check the buckets for both the source and destination locations.
|
||||
if self._cloud_bucket is None:
|
||||
logger.error('Cloud bucket not found for location %s; Configuration is probably invalid!',
|
||||
self._bucket_name)
|
||||
return
|
||||
|
||||
if destination._cloud_bucket is None:
|
||||
logger.error('Cloud bucket not found for location %s; Configuration is probably invalid!',
|
||||
destination._bucket_name)
|
||||
return
|
||||
|
||||
# Perform the copy.
|
||||
logger.debug('Copying file from %s to %s via a direct boto copy', self._cloud_bucket,
|
||||
destination._cloud_bucket)
|
||||
|
||||
source_path = self._init_path(path)
|
||||
source_key = self._key_class(self._cloud_bucket, source_path)
|
||||
|
||||
destination._initialize_cloud_conn()
|
||||
dest_path = destination._init_path(path)
|
||||
source_key.copy(destination._cloud_bucket, dest_path)
|
||||
return
|
||||
|
|
Reference in a new issue