Issue #6476
Repomd compression behaves differently for S3
Status:
NEW
Priority:
Normal
Assignee:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
on repomd we have:
primary.xml.gz
update_info.xml.gz
When testing xml.gz behaves like it is not compressed
On the other hand, it behaves as compressed on S3 testing
https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/tests/functional/api/test_publish.py#L51-L67
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
History
#3
Updated by fao89 12 months ago
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