Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Azure ResourceName and InstanceName columns #521

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading