Repomd compression behaves differently for S3
on repomd we have:
When testing xml.gz behaves like it is not compressed
On the other hand, it behaves as compressed on S3 testing
def read_xml_gz(content): """ Read xml and xml.gz. Tests work normally but fails for S3 due '.gz' Why is it only compressed for S3? """ with NamedTemporaryFile() as temp_file: temp_file.write(content) temp_file.seek(0) try: content_xml = gzip.open(temp_file.name).read() except OSError: # FIXME: fix this as in CI primary/update_info.xml has '.gz' but it is not gzipped content_xml = temp_file.read() return content_xml
I tested with real S3 bucket and got the same behavior, with:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' MEDIA_ROOT = ''
primary.xml.gz is compressed, as we expect but for:
DEFAULT_FILE_STORAGE = 'pulpcore.app.models.storage.FileSystem' MEDIA_ROOT = '/var/lib/pulp/'
primary.xml.gz does have the gz suffix, but it is not compressed
Please register to edit this issue