Commit 97d0cd51 by diegolima

Mostrar SKUs

1 parent cbb17bec
Showing with 6 additions and 6 deletions
......@@ -39,10 +39,10 @@ else:
print("Product type not supported")
sys.exit(1)
with urllib.request.urlopen(CATALOG) as url:
DATA = json.loads(url.read().decode())
# with open(FCATALOG) as url:
# DATA = json.load(url)
#with urllib.request.urlopen(CATALOG) as url:
# DATA = json.loads(url.read().decode())
with open(FCATALOG) as url:
DATA = json.load(url)
for product in DATA["products"]:
if DATA['products'][product].get('productFamily') == PRODUCT_FAMILY:
sku = DATA['products'][product].get('sku')
......@@ -62,10 +62,10 @@ with urllib.request.urlopen(CATALOG) as url:
else:
sharedcores = 'nonshared'
if DATA['products'][product]['attributes']['tenancy'] == 'Shared':
print('aws,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, sharedcores))
print('aws,%s,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, sharedcores, sku))
elif PRODUCT_TYPE == 'database':
os = DATA['products'][product]['attributes']['databaseEngine']
edition = DATA['products'][product]['attributes'].get('databaseEdition')
licensemodel = DATA['products'][product]['attributes']['licenseModel']
deployment = DATA['products'][product]['attributes']['deploymentOption']
print('aws,%s,%s,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, edition, licensemodel, deployment))
print('aws,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, edition, licensemodel, deployment, sku))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!