Compare commits

..

No commits in common. "8201535b5b7a7a46285e6ebcafc814cabb512483" and "75de65fe715e98c61cb520c4f6d6da9baa6f04b6" have entirely different histories.

5 changed files with 2 additions and 9 deletions

View File

@ -106,9 +106,6 @@ pvc:
success: "✅" # A task succeeded success: "✅" # A task succeeded
failure: "❌" # A task failed failure: "❌" # A task failed
completed: "👌" # A task is completed completed: "👌" # A task is completed
# A trigger word (no whitespace) added to the end of the completed cluster message; this can be used
# for pings in various chat systems (e.g. Mattermost)
completed_triggerword: "#pvcbootstrapcompleted"
# The webhook body elements; this is specific to the webhook target, and is converted into raw # The webhook body elements; this is specific to the webhook target, and is converted into raw
# JSON before sending. # JSON before sending.
# Two special variables are used: "{icon}" displays one of the above icons, and "{message}" displays # Two special variables are used: "{icon}" displays one of the above icons, and "{message}" displays

View File

@ -35,7 +35,6 @@ pvc:
enabled: false enabled: false
uri: https://mattermost.domain.tld/hooks/asecretstring uri: https://mattermost.domain.tld/hooks/asecretstring
action: post action: post
completed_triggerword: "#pvcbootstrapcompleted"
icons: icons:
info: "❕" # A note about an event info: "❕" # A note about an event
begin: "🤞" # A task is beginning begin: "🤞" # A task is beginning

View File

@ -205,7 +205,7 @@ def read_config():
) )
# Get the Notifications configuration # Get the Notifications configuration
for key in ["enabled", "uri", "action", "icons", "body", "completed_triggerword"]: for key in ["enabled", "uri", "action", "icons", "body"]:
try: try:
config[f"notifications_{key}"] = o_notifications[key] config[f"notifications_{key}"] = o_notifications[key]
except Exception: except Exception:

View File

@ -157,4 +157,4 @@ def host_checkin(config, data):
# Hosts will now power down ready for real activation in production # Hosts will now power down ready for real activation in production
sleep(30) sleep(30)
cluster = db.update_cluster_state(config, cspec_cluster, "completed") cluster = db.update_cluster_state(config, cspec_cluster, "completed")
notifications.send_webhook(config, "completed", f"Cluster {cspec_cluster}: PVC bootstrap deployment completed") notifications.send_webhook(config, "completed", f"Cluster {cspec_cluster}: Deployment completed")

View File

@ -38,9 +38,6 @@ def send_webhook(config, status, message):
logger.debug(f"Sending notification to {config['notifications_uri']}") logger.debug(f"Sending notification to {config['notifications_uri']}")
if status == "completed" and config["notifications_completed_triggerword"]:
message = f"{message} {config['notifications_completed_triggerword']}"
# Get the body data # Get the body data
body = config['notifications_body'] body = config['notifications_body']
formatted_body = dict() formatted_body = dict()