Skip to content
Snippets Groups Projects
Commit 1b480e71 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

ROHD-1175: automatically append .tar or .tar.gz to surls if needed

parent 38466ceb
No related branches found
No related tags found
No related merge requests found
......@@ -232,6 +232,23 @@ class LtaCp:
# determine if input is file
input_is_file = self.is_soure_single_file()
if not input_is_file:
# make sure the file extension is .tar or .tar.gz
missing_suffix = ""
if self.gzip:
if not (self.dst_surl.endswith(".tar.gz") or self.dst_surl.endswith(".tgz")):
if self.dst_surl.endswith(".tar"):
missing_suffix = ".gz"
else:
missing_suffix = ".tar.gz"
else:
if not self.dst_surl.endswith(".tar"):
missing_suffix = ".tar"
if missing_suffix:
self.dst_surl += missing_suffix
logger.info("ltacp %s: appending missing suffix %s to surl: %s", self.logId, missing_suffix, self.dst_surl)
dst_turl = convert_surl_to_turl(self.dst_surl)
logger.info('ltacp %s: initiating transfer of %s:%s to surl=%s turl=%s' % (self.logId,
self.src_host,
......@@ -520,7 +537,7 @@ class LtaCp:
logger.info('ltacp %s: remote and local md5 checksums are equal: %s' % (self.logId, md5_checksum_local,))
logger.info('ltacp %s: fetching adler32 checksum from LTA...' % self.logId)
srm_ok, srm_file_size, srm_a32_checksum = get_srm_size_and_a32_checksum(self.dst_surl, 'ltacp %s ' % self.logId)
srm_ok, srm_file_size, srm_a32_checksum = get_srm_size_and_a32_checksum(self.dst_surl, 'ltacp %s:' % self.logId)
if not srm_ok:
raise LtacpException('ltacp %s: Could not get srm adler32 checksum for: %s' % (self.logId, self.dst_surl))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment