Commit fa6bf9ca by Diego Lima

Adicionar suporte a licenciamento de SO

1 parent 74c0691f
Showing with 12 additions and 3 deletions
......@@ -54,6 +54,8 @@ with open(FCATALOG) as url:
region = locationmap(DATA['products'][product]['attributes']['location'])
cpu = DATA['products'][product]['attributes']['vcpu']
memory = str(DATA['products'][product]['attributes']['memory']).replace(',','')
license = DATA['products'][product]['attributes']['licenseModel']
software = DATA['products'][product]['attributes']['preInstalledSw']
if PRODUCT_TYPE == 'compute':
os = DATA['products'][product]['attributes']['operatingSystem']
family = str(name[:1])
......@@ -62,7 +64,7 @@ with open(FCATALOG) as url:
else:
sharedcores = 'nonshared'
if DATA['products'][product]['attributes']['tenancy'] == 'Shared':
print('aws,%s,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, sharedcores, sku))
print('aws,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s' % (name, cpu, memory, cost, region, os, sharedcores, sku, license, software))
elif PRODUCT_TYPE == 'database':
os = DATA['products'][product]['attributes']['databaseEngine']
edition = DATA['products'][product]['attributes'].get('databaseEdition')
......
......@@ -46,8 +46,11 @@ with urllib.request.urlopen(CATALOG) as url:
cores = prod["cores"]
memory = str(prod["ram"]) + " GB"
sharedcores = 'shared' if name[:1] == 'b' else 'nonshared'
sku = ''
license = 'No License required'
software = 'NA'
for region in REGIONS:
cost = prod["prices"].get(region)
if cost:
cost = cost['value']
print("azure,%s,%s,%s,%s,%s,%s,%s" %(name, cores, memory, cost, region, os, sharedcores))
print("azure,%s,%s,%s,%s,%s,%s,%s" %(name, cores, memory, cost, region, os, sharedcores, sku, license, software))
......@@ -95,7 +95,10 @@ with open(FCATALOG) as url:
else:
sharedcores = 'nonshared'
realcpu = cpu
print('google,%s,%s,%s,%s,%s,%s,%s' % (name, realcpu, memory, cost, region, os, sharedcores))
sku = ''
license = 'No License required'
software = 'NA'
print('google,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s' % (name, realcpu, memory, cost, region, os, sharedcores, sku, license, software))
else:
realname = realname.replace('pg-','')
print('google,%s,%s,%s,%s,%s,%s' % (realname, cpu, memory, cost, region, os))
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!