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: ...@@ -54,6 +54,8 @@ with open(FCATALOG) as url:
region = locationmap(DATA['products'][product]['attributes']['location']) region = locationmap(DATA['products'][product]['attributes']['location'])
cpu = DATA['products'][product]['attributes']['vcpu'] cpu = DATA['products'][product]['attributes']['vcpu']
memory = str(DATA['products'][product]['attributes']['memory']).replace(',','') memory = str(DATA['products'][product]['attributes']['memory']).replace(',','')
license = DATA['products'][product]['attributes']['licenseModel']
software = DATA['products'][product]['attributes']['preInstalledSw']
if PRODUCT_TYPE == 'compute': if PRODUCT_TYPE == 'compute':
os = DATA['products'][product]['attributes']['operatingSystem'] os = DATA['products'][product]['attributes']['operatingSystem']
family = str(name[:1]) family = str(name[:1])
...@@ -62,7 +64,7 @@ with open(FCATALOG) as url: ...@@ -62,7 +64,7 @@ with open(FCATALOG) as url:
else: else:
sharedcores = 'nonshared' sharedcores = 'nonshared'
if DATA['products'][product]['attributes']['tenancy'] == 'Shared': 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': elif PRODUCT_TYPE == 'database':
os = DATA['products'][product]['attributes']['databaseEngine'] os = DATA['products'][product]['attributes']['databaseEngine']
edition = DATA['products'][product]['attributes'].get('databaseEdition') edition = DATA['products'][product]['attributes'].get('databaseEdition')
......
...@@ -46,8 +46,11 @@ with urllib.request.urlopen(CATALOG) as url: ...@@ -46,8 +46,11 @@ with urllib.request.urlopen(CATALOG) as url:
cores = prod["cores"] cores = prod["cores"]
memory = str(prod["ram"]) + " GB" memory = str(prod["ram"]) + " GB"
sharedcores = 'shared' if name[:1] == 'b' else 'nonshared' sharedcores = 'shared' if name[:1] == 'b' else 'nonshared'
sku = ''
license = 'No License required'
software = 'NA'
for region in REGIONS: for region in REGIONS:
cost = prod["prices"].get(region) cost = prod["prices"].get(region)
if cost: if cost:
cost = cost['value'] 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: ...@@ -95,7 +95,10 @@ with open(FCATALOG) as url:
else: else:
sharedcores = 'nonshared' sharedcores = 'nonshared'
realcpu = cpu 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: else:
realname = realname.replace('pg-','') realname = realname.replace('pg-','')
print('google,%s,%s,%s,%s,%s,%s' % (realname, cpu, memory, cost, region, os)) 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!