Skip to content

Commit

Permalink
Pull resource group from instance id (#519)
Browse files Browse the repository at this point in the history
* Pull resource group name from instance_id
  • Loading branch information
esebesto authored Jul 26, 2024
1 parent e143da9 commit e7295d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.6.1"
__version__ = "4.6.2"

VERSION = __version__.split(".")
5 changes: 3 additions & 2 deletions nise/generators/azure/azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
"BillingPeriodEndDate",
"BillingProfileId",
"BillingProfileName",
"InstanceName",
"InvoiceSectionId",
"IsAzureCreditEligible",
"PartNumber",
Expand All @@ -85,7 +84,6 @@
"resellerMpnId",
"servicePeriodEndDate",
"servicePeriodStartDate",
"Product",
"ProductId",
"publisherId",
"Location",
Expand Down Expand Up @@ -419,6 +417,9 @@ def _update_data(self, row, start, end, **kwargs):
row, meter_sub, str(amount), str(rate), str(cost), instance_id, service_tier
)

if instance_id and "resourceGroups/" in instance_id:
resource_group = instance_id.split("resourceGroups/")[-1].split("/")[0]

if self.azure_columns is AZURE_COLUMNS_V2_SUBSCRIPTION:
row["SubscriptionId"] = self.subscription_guid
row["ResourceGroupName"] = resource_group
Expand Down

0 comments on commit e7295d0

Please sign in to comment.