From f6c8b6c305fefa227543d9d62cdfb9da05ef3603 Mon Sep 17 00:00:00 2001 From: Luke Couzens Date: Wed, 18 Dec 2024 18:14:31 +0000 Subject: [PATCH 1/2] fix bug in tag matching logic --- koku/masu/util/aws/common.py | 1 - koku/masu/util/azure/common.py | 1 - 2 files changed, 2 deletions(-) diff --git a/koku/masu/util/aws/common.py b/koku/masu/util/aws/common.py index 8394a4da12..4c70c1d0b9 100644 --- a/koku/masu/util/aws/common.py +++ b/koku/masu/util/aws/common.py @@ -901,7 +901,6 @@ def match_openshift_resources_and_labels(data_frame, cluster_topologies, matched data_frame["special_case_tag_matched"] = False tags = data_frame["resourcetags"] if not tags.eq("").all(): - tags = tags.str.lower() LOG.info("Matching OpenShift on AWS by tags.") special_case_tag_matched = tags.str.contains( "|".join(["openshift_cluster", "openshift_project", "openshift_node"]) diff --git a/koku/masu/util/azure/common.py b/koku/masu/util/azure/common.py index c2f291660b..0b46173ea6 100644 --- a/koku/masu/util/azure/common.py +++ b/koku/masu/util/azure/common.py @@ -171,7 +171,6 @@ def match_openshift_resources_and_labels(data_frame, cluster_topologies, matched data_frame["special_case_tag_matched"] = False tags = data_frame["tags"] if not tags.eq("").all(): - tags = tags.str.lower() LOG.info("Matching OpenShift on Azure by tags.") special_case_tag_matched = tags.str.contains( "|".join(["openshift_cluster", "openshift_project", "openshift_node"]) From 34ab3d49ebfceda8df60ae94c4bd7fde723723b9 Mon Sep 17 00:00:00 2001 From: Luke Couzens Date: Wed, 18 Dec 2024 18:46:38 +0000 Subject: [PATCH 2/2] keep lower for special checks --- koku/masu/util/aws/common.py | 3 ++- koku/masu/util/azure/common.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koku/masu/util/aws/common.py b/koku/masu/util/aws/common.py index 4c70c1d0b9..0dc95642ab 100644 --- a/koku/masu/util/aws/common.py +++ b/koku/masu/util/aws/common.py @@ -901,8 +901,9 @@ def match_openshift_resources_and_labels(data_frame, cluster_topologies, matched data_frame["special_case_tag_matched"] = False tags = data_frame["resourcetags"] if not tags.eq("").all(): + tags_lower = tags.str.lower() LOG.info("Matching OpenShift on AWS by tags.") - special_case_tag_matched = tags.str.contains( + special_case_tag_matched = tags_lower.str.contains( "|".join(["openshift_cluster", "openshift_project", "openshift_node"]) ) data_frame["special_case_tag_matched"] = special_case_tag_matched diff --git a/koku/masu/util/azure/common.py b/koku/masu/util/azure/common.py index 0b46173ea6..afb2671200 100644 --- a/koku/masu/util/azure/common.py +++ b/koku/masu/util/azure/common.py @@ -171,8 +171,9 @@ def match_openshift_resources_and_labels(data_frame, cluster_topologies, matched data_frame["special_case_tag_matched"] = False tags = data_frame["tags"] if not tags.eq("").all(): + tags_lower = tags.str.lower() LOG.info("Matching OpenShift on Azure by tags.") - special_case_tag_matched = tags.str.contains( + special_case_tag_matched = tags_lower.str.contains( "|".join(["openshift_cluster", "openshift_project", "openshift_node"]) ) data_frame["special_case_tag_matched"] = special_case_tag_matched