@@ -332,6 +332,13 @@ def _get_additional_info(self, result: dict, options: dict, tenant_id: str = Non
332
332
333
333
additional_info ["Term" ] = term
334
334
335
+ if azure_additional_info := result .get ("additionalinfo" ):
336
+ azure_additional_info : dict = json .loads (azure_additional_info )
337
+ if ri_normalization_ratio := azure_additional_info .get (
338
+ "RINormalizationRatio"
339
+ ):
340
+ additional_info ["RI Normalization Ratio" ] = ri_normalization_ratio
341
+
335
342
if options .get ("cost_metric" ) == "AmortizedCost" :
336
343
if result .get ("pricingmodel" ) in ["Reservation" , "SavingsPlan" ]:
337
344
meter_id = result .get ("meterid" )
@@ -658,18 +665,25 @@ def _make_scope(
658
665
659
666
@staticmethod
660
667
def _convert_tags_str_to_dict (tags_str : Union [str , None ]) -> dict :
668
+ tags = {}
661
669
try :
662
- if tags_str is None :
663
- return {}
670
+ if tags_str :
671
+ if tags_str [0 ] != "{" and tags_str [:- 1 ] != "}" :
672
+ tags_str = "{" + tags_str + "}"
673
+
674
+ # todo: temporary remove key value include "."
675
+ tags_info : dict = json .loads (tags_str )
664
676
665
- if tags_str [0 ] != "{" and tags_str [:- 1 ] != "}" :
666
- tags_str = "{" + tags_str + "}"
677
+ for key in tags_info .keys ():
678
+ if "." not in key :
679
+ tags [key ] = tags_info [key ]
667
680
668
- tags = json .loads (tags_str )
669
681
return tags
670
682
except Exception as e :
671
- _LOGGER .error (f"[_convert_tags_str_to_dict] tags : { tags_str } { e } " )
672
- return {}
683
+ _LOGGER .error (
684
+ f"[_convert_tags_str_to_dict] tags : { tags_str } { e } " , exc_info = True
685
+ )
686
+ return tags
673
687
674
688
@staticmethod
675
689
def _set_product_from_benefit_name (benefit_name ):
0 commit comments