Created
March 16, 2018 02:58
-
-
Save georgexsh/8c6edf59506ce3e826b68446424ba4fa to your computer and use it in GitHub Desktop.
calculate chef yum repo size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
total = 0 | |
for arch in ['aarch64', 'ppc64', 'ppc64le', 's390x', 'x86_64']: | |
for ver in range(5, 8): | |
r = requests.get(f'https://packages.chef.io/repos/yum/stable/el/{ver}/{arch}/') | |
s = r.text | |
m = re.findall(r'([\d.]+) MB', r.text) | |
one = sum(map(float, m)) | |
print(arch, ver, one) | |
total += one | |
print(total/1024, 'TB') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment