-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fixed the send agg mail message: #731
Conversation
@@ -195,6 +195,7 @@ def __init__(self): | |||
self._environment_variables_dict['DEFAULT_ADMINS'] = literal_eval(EnvironmentVariables.get_env('DEFAULT_ADMINS', '[]')) | |||
self._environment_variables_dict['KERBEROS_USERS'] = literal_eval(EnvironmentVariables.get_env('KERBEROS_USERS', '[]')) | |||
self._environment_variables_dict['POLICIES_TO_ALERT'] = literal_eval(EnvironmentVariables.get_env('POLICIES_TO_ALERT', '[]')) | |||
self._environment_variables_dict['ONLY_ADMINS'] = EnvironmentVariables.get_boolean_from_environment('ONLY_ADMINS', False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need admin email list ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,
I added the extra var EMAIL_TO here we can add the admin mail and EMIAL_CC to add other users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@athiruma Pls fix it as we discussed, ADMINS_ONLY (instead of ONLY_ADMINS) should be list of emails, if the list is filled, need to send the email TO it, if it empty should send email per user resource.
@athiruma, pls change account to dictionary: |
1d14b87
to
aec69e2
Compare
aec69e2
to
d4d5041
Compare
self.__policy_action_days = self.__environment_variables.get('POLICY_ACTIONS_DAYS') | ||
self.__days_to_delete_resource = int(self.__environment_variables.get('DAYS_TO_DELETE_RESOURCE')) | ||
self.__mail_to = self.__environment_variables.get('EMAIL_TO') # testing purposes | ||
self.__mail_cc = self.__environment_variables.get('EMAIL_CC', []) | ||
self.__mail_message = MailMessage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need EMAIL_TO and EMAIL_CC, do we use it anywhere ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It forcefully replaces to and cc. I used this variable to work on local env and running in dev containers.
I dont see ADMINS_ONLY, are you using DEFAULT_ADMINS variable ? |
ADMIN_MAIL_LIST this one. |
Why we cannot using DEFAULT_ADMINS ? |
No special reason. We have an admin list so named it ADMIN_MAIL_LIST. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
Type of change
Note: Fill x in []
Description
Sending the aggregated mail report by using the elastic search.
This helps us to verify upcoming resources that to be deleted.
For security reasons, all pull requests need to be approved first before running any automated CI