Skip to content

Instantly share code, notes, and snippets.

@georgexsh
Created March 16, 2018 02:58
Show Gist options
  • Save georgexsh/8c6edf59506ce3e826b68446424ba4fa to your computer and use it in GitHub Desktop.
Save georgexsh/8c6edf59506ce3e826b68446424ba4fa to your computer and use it in GitHub Desktop.
calculate chef yum repo size
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