Skip to content

Commit

Permalink
Fix Azure ResourceName and InstanceName columns
Browse files Browse the repository at this point in the history
  • Loading branch information
esebesto committed Jul 29, 2024
1 parent b0f4815 commit 9525dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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.3"
__version__ = "4.6.4"

VERSION = __version__.split(".")
7 changes: 3 additions & 4 deletions nise/generators/azure/azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,8 @@ def _update_data(self, row, start, end, **kwargs):
row["ResourceGroup"] = resource_group
row["MarketPrice"] = 0

resource_name = ""
if kwargs.get("instance_id"):
resource_name = kwargs.get("instance_id").split("/")
resource_name = resource_name[len(resource_name) - 1]
resource_name = instance_id.split("/")[-1] if instance_id else ""

if self._service_name == "Virtual Machines":
if getattr(self, "_CCSP", False):
publisher_name = "Microsoft"
Expand Down Expand Up @@ -510,6 +508,7 @@ def _map_header_to_report_version(self, row, meter_sub, amount, rate, cost, inst
row["ResourceId"] = instance_id
row["BillingCurrency"] = self._billing_currency
else:
row["InstanceName"] = instance_id
row["BillingCurrencyCode"] = self._billing_currency

return row
Expand Down

0 comments on commit 9525dde

Please sign in to comment.