Closed etsauer closed 5 years ago
@etsauer hitting the following error on OCP4 and OCP3 environments
new namespace quota
{'cluster': {'quota': {'cpu': '', 'memory': ''}}, 'namespaces': {'esauer-sbx': {'quota': {'cpu': 4, 'memory': 17179869184}}}}
existing namespace quota
{'cluster': {'quota': {'cpu': '', 'memory': ''}}, 'namespaces': {'esauer-sbx': {'quota': {'cpu': 2, 'memory': 12884901888}}}}
Traceback (most recent call last):
File "./cli.py", line 79, in <module>
do_print(capacity)
File "./cli.py", line 8, in do_print
cluster_memory = capacity["cluster"]["totals"]["memory"]
KeyError: 'totals'
@sabre1041 fixed.
@etsauer looks good. One additional change is to add the application/json
Content-Type
for the hosted solution. We should be good to merge at that point
LGTM
This is a refactoring and enhancement to the capacity management script. It now has several components:
cli.py
) that can be run from the command line to print the data, either formatted (like before) or raw json outputView instructions in capacity-management/README.md for testing.