Commit 5b2415f4 by Diego Lima

Aplicar descontos nos preços

1 parent fa6bf9ca
Showing with 5 additions and 5 deletions
...@@ -29,10 +29,10 @@ GCE_REGIONS = [ ...@@ -29,10 +29,10 @@ GCE_REGIONS = [
] ]
GCE_OS = ['linux', 'win', 'rhel', 'suse', 'suse-sap', 'sql-standard', 'sql-web', 'sql-enterprise'] GCE_OS = ['linux', 'win', 'rhel', 'suse', 'suse-sap', 'sql-standard', 'sql-web', 'sql-enterprise']
#with urllib.request.urlopen(CATALOG) as url: with urllib.request.urlopen(CATALOG) as url:
# DATA = json.loads(url.read().decode()) DATA = json.loads(url.read().decode())
with open(FCATALOG) as url: #with open(FCATALOG) as url:
DATA = json.load(url) # DATA = json.load(url)
for product in DATA['gcp_price_list']: for product in DATA['gcp_price_list']:
if 'CUSTOM-VM-' not in product: if 'CUSTOM-VM-' not in product:
if PRODUCT_FAMILY in product: # Discard non-product entries if PRODUCT_FAMILY in product: # Discard non-product entries
...@@ -52,7 +52,7 @@ with open(FCATALOG) as url: ...@@ -52,7 +52,7 @@ with open(FCATALOG) as url:
for region in GCE_REGIONS: for region in GCE_REGIONS:
cost = DATA['gcp_price_list'][product][region] cost = DATA['gcp_price_list'][product][region]
if PRODUCT_FAMILY == COMPUTE_PRODUCT_FAMILY: if PRODUCT_FAMILY == COMPUTE_PRODUCT_FAMILY:
cost = DATA['gcp_price_list'][product][region] cost = cost-(cost*0.3)
if float(cost) != 0 : if float(cost) != 0 :
for os in GCE_OS: for os in GCE_OS:
if os == 'linux': if os == 'linux':
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!