diff --git a/LTA/LTAIngest/LTAIngestServer/LTAIngestTransferServer/lib/ltacp.py b/LTA/LTAIngest/LTAIngestServer/LTAIngestTransferServer/lib/ltacp.py index 4ce52c04561d050720797a196cba44c782c0f833..c5775838a79c975dbe173a38cdb8a3454853f871 100755 --- a/LTA/LTAIngest/LTAIngestServer/LTAIngestTransferServer/lib/ltacp.py +++ b/LTA/LTAIngest/LTAIngestServer/LTAIngestTransferServer/lib/ltacp.py @@ -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))