From 5efc99a22fc168f6fe024a52c8b725225e0a5f74 Mon Sep 17 00:00:00 2001 From: Will Foster Date: Fri, 27 Nov 2020 13:25:01 +0000 Subject: [PATCH] feat: optional note to tenants about expirations. * Configurable option "notify_until_extended:" for quads.yml * Default set to "True" * Adds message in expiration notifications that users can ignore expiration warnings if they've already submitted an extension request. * Reason: Hopefully this will cut down on duplicate extension requests as folks may not know that JIRA and MongoDB are not tied together (and we actually want repeated notifications for expiration for awareness). * This is temporary until a better solution is in place: https://github.com/redhat-performance/quads/issues/350 Change-Id: I042fc20fd7e9b58c207dad82634bf889926252d0 --- conf/quads.yml | 13 ++++++++++++- quads/templates/message | 7 +++++++ quads/tools/notify.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/conf/quads.yml b/conf/quads.yml index 872710274..d12e0a84c 100644 --- a/conf/quads.yml +++ b/conf/quads.yml @@ -231,4 +231,15 @@ default_wipe: True models: R620,R630,R640,R930,R730XD,FC640,6018R,6048R,1029U-TRTP,1029U-TN10RT,1029P,5039MS,6049P # Amount of hours for locking a cloud for redefinition -cloud_reservation_lock: 48 \ No newline at end of file +cloud_reservation_lock: 48 + +# Continue to send notifications for expiration until assignments are +# actually extended. We set this because our ticket system (JIRA) is not tied +# into QUADS to silence expiration notices if an expiration request is +# submitted, only when it's executed will notifications cease. +# Unless you have done custom modification of notify.py/QUADS to tie toggling +# MongoDB flags for 'message' you want to leave this alone. +# Leaving the below to True will include a message in expiration notifications +# that users can ignore future expiration warnings if they have already +# submitted an extension request but it hasn't been executed yet. +quads_notify_until_extended: True diff --git a/quads/templates/message b/quads/templates/message index ecf0cb769..4586fde9b 100644 --- a/quads/templates/message +++ b/quads/templates/message @@ -31,6 +31,13 @@ of your expiration date. {% endif %} +{% if quads_notify_until_extended %} +If you have already submitted an extension you can disregard +this message, our system will continue to send out expiration +notices until the actual extension is executed. + +{% endif %} + Docs: {{ wp_wiki }}/faq/ diff --git a/quads/tools/notify.py b/quads/tools/notify.py index ee97d39b1..c75cb5867 100755 --- a/quads/tools/notify.py +++ b/quads/tools/notify.py @@ -92,6 +92,7 @@ def create_message( wp_wiki=conf["wp_wiki"], quads_request_url=quads_request_url, quads_request_deadline_day=conf["quads_request_deadline_day"], + quads_notify_until_extended=conf["quads_notify_until_extended"], cloud=cloud, hosts=host_list_expire, )