Skip to content

Commit

Permalink
correct azure v2 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
lcouzens committed Aug 8, 2023
1 parent de14a69 commit 8e1064e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nise/generators/azure/azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"Date",
"ProductName",
"MeterCategory",
"MeterSubCategory",
"MeterSubcategory",
"MeterId",
"MeterName",
"MeterRegion",
Expand Down Expand Up @@ -297,9 +297,9 @@ def _get_location(self):

def _add_common_usage_info(self, row, start, end, **kwargs):
"""Add common usage information."""
row["SubscriptionGuid"] = self.subscription_guid
if self.azure_columns == AZURE_COLUMNS_V2:
usage_account = choice(self.usage_accounts)
row["SubscriptionId"] = self.subscription_guid
row["SubscriptionName"] = self.account_info.get("subscription_name")
row["AccountName"] = usage_account[0]
row["AccountOwnerId"] = usage_account[1]
Expand All @@ -311,7 +311,6 @@ def _add_common_usage_info(self, row, start, end, **kwargs):
row["BillingPeriodStartDate"] = self.first_day_of_month(start).strftime(DATE_FMT)
row["BillingPeriodEndDate"] = self.last_day_of_month(start).strftime(DATE_FMT)
else:
row["SubscriptionGuid"] = self.subscription_guid
row["UsageDateTime"] = start
return row

Expand Down

0 comments on commit 8e1064e

Please sign in to comment.