Skip to content

Commit

Permalink
Fix contract type column on cooper report
Browse files Browse the repository at this point in the history
  • Loading branch information
marcserrat committed Sep 23, 2022
1 parent c2a9b6e commit 3f0d97b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions reports/ms_cooper/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def process_subscription(client, subscription):
convert_to_datetime(subscription["events"]["created"]["at"]),
convert_to_datetime(subscription["events"]["updated"]["at"]) if 'updated' in subscription['events'] else '-',
subscription["connection"]["type"].capitalize(),
subscription["contract"].get("type", "distribution").capitalize(),
get_contract_type(subscription.get("contract",{}).get('id','Distribution')),
subscription['product']['id'],
subscription['product']['name'],
str(subscription.get('billing', {}).get('period', {}).get('delta','')) + " " + subscription.get('billing', {}).get('period', {}).get('uom', 'Perpetual').capitalize(),
Expand Down Expand Up @@ -263,4 +263,9 @@ def populate_products(client):
PRODUCTS.append(product['id'])
# Empty print due CLI Execution
print("")
print(f"Amount of products from microsoft to include in report {len(PRODUCTS)}")
print(f"Amount of products from microsoft to include in report {len(PRODUCTS)}")

def get_contract_type(contract):
if contract.startswith("CRD-"):
return "Distribution"
return "Syndication"

0 comments on commit 3f0d97b

Please sign in to comment.