Automated PaŃkage versions update for tags
Module repos.py
- ReposInfo(), walks mirror using HTTP and builds
all repos map available
- RepoManager(), using repos map builds package versions map
either for specific tags or for all of them
Fixes:
- Progress class clears line remainder on change
Utils:
- Download GZ file into memory
- TGZ file interface, CRU (no deletion)
Change-Id: Ifdb37aa4b68fb25f642b2089cf16cd242ed25a0b
Related-PROD: PROD-28199
diff --git a/cfg_checker/common/file_utils.py b/cfg_checker/common/file_utils.py
index d508121..684fc30 100644
--- a/cfg_checker/common/file_utils.py
+++ b/cfg_checker/common/file_utils.py
@@ -82,3 +82,14 @@
}
return _dict
+
+
+def get_gzipped_file(url):
+ # imports
+ from io import BytesIO
+ from requests import get
+ import gzip
+ # download a file
+ _bytes = BytesIO(get(url).content)
+ with gzip.GzipFile(fileobj=_bytes) as gz:
+ return gz.read()