Skip to content

Commit

Permalink
Small change
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Damian authored and Adrian Damian committed Apr 11, 2024
1 parent 9b115cb commit 683b918
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions vos/vos/vos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,24 +1820,23 @@ def copy(self, source, destination, send_md5=False, disposition=False,
cutout = None
check_md5 = True
src_md5 = None
src_size = 0
src_size = None
if new_vos:
if new_vos:
files_url = self.get_node_url(source, method='GET',
cutout=cutout,
view=view)
if files_url:
try:
response = self.get_session(source).head(files_url)
response.raise_for_status()
src_md5 = net.extract_md5(response.headers)
src_size = response.headers.get('Content-Length', 0)
get_urls.append(
self._add_soda_ops(files_url, view=view, cutout=cutout))
except Exception:
# not much to do. With transfer negotiation it could
# try a different URL.
pass
files_url = self.get_node_url(source, method='GET',
cutout=cutout,
view=view)
if files_url:
try:
response = self.get_session(source).head(files_url)
response.raise_for_status()
src_md5 = net.extract_md5(response.headers)
src_size = response.headers.get('Content-Length', None)
get_urls.append(
self._add_soda_ops(files_url, view=view, cutout=cutout))
except Exception:

Check warning on line 1836 in vos/vos/vos.py

View check run for this annotation

Codecov / codecov/patch

vos/vos/vos.py#L1836

Added line #L1836 was not covered by tests
# not much to do. With transfer negotiation it could
# try a different URL.
pass

Check warning on line 1839 in vos/vos/vos.py

View check run for this annotation

Codecov / codecov/patch

vos/vos/vos.py#L1839

Added line #L1839 was not covered by tests
else:
source_props = self.get_node(source, force=True).props
src_md5 = source_props.get('MD5', None)
Expand Down

0 comments on commit 683b918

Please sign in to comment.