From 0889b98ee03984eb123d68ec9aef130c70a1c337 Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti <97395760+athiruma@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:45:00 +0530 Subject: [PATCH] Fixed the send_email_aggregation issue (#744) --- cloud_governance/main/environment_variables.py | 1 + .../policy/common_policies/send_aggregated_alerts.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud_governance/main/environment_variables.py b/cloud_governance/main/environment_variables.py index 57c9368b..73251eec 100644 --- a/cloud_governance/main/environment_variables.py +++ b/cloud_governance/main/environment_variables.py @@ -257,6 +257,7 @@ def get_aws_account_alias_name(self): account_alias = iam_client.list_account_aliases()['AccountAliases'] if account_alias: return account_alias[0].upper() + return os.environ.get('account', '').upper() except: return os.environ.get('account', '').upper() diff --git a/cloud_governance/policy/common_policies/send_aggregated_alerts.py b/cloud_governance/policy/common_policies/send_aggregated_alerts.py index e65732ce..8d5ebd66 100644 --- a/cloud_governance/policy/common_policies/send_aggregated_alerts.py +++ b/cloud_governance/policy/common_policies/send_aggregated_alerts.py @@ -30,7 +30,7 @@ def __get_es_data(self): :return: :rtype: """ - current_date = (datetime.utcnow().date() - timedelta(days=1)).__str__() + current_date = (datetime.utcnow().date()).__str__() policy_es_index = self.__environment_variables.get('es_index') account_name = (self.__environment_variables.get('account', '').upper() .replace('OPENSHIFT-', '')