Compare commits
No commits in common. "8201535b5b7a7a46285e6ebcafc814cabb512483" and "75de65fe715e98c61cb520c4f6d6da9baa6f04b6" have entirely different histories.
8201535b5b
...
75de65fe71
@ -106,9 +106,6 @@ pvc:
|
||||
success: "✅" # A task succeeded
|
||||
failure: "❌" # A task failed
|
||||
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
|
||||
# JSON before sending.
|
||||
# Two special variables are used: "{icon}" displays one of the above icons, and "{message}" displays
|
||||
|
@ -35,7 +35,6 @@ pvc:
|
||||
enabled: false
|
||||
uri: https://mattermost.domain.tld/hooks/asecretstring
|
||||
action: post
|
||||
completed_triggerword: "#pvcbootstrapcompleted"
|
||||
icons:
|
||||
info: "❕" # A note about an event
|
||||
begin: "🤞" # A task is beginning
|
||||
|
@ -205,7 +205,7 @@ def read_config():
|
||||
)
|
||||
|
||||
# Get the Notifications configuration
|
||||
for key in ["enabled", "uri", "action", "icons", "body", "completed_triggerword"]:
|
||||
for key in ["enabled", "uri", "action", "icons", "body"]:
|
||||
try:
|
||||
config[f"notifications_{key}"] = o_notifications[key]
|
||||
except Exception:
|
||||
|
@ -157,4 +157,4 @@ def host_checkin(config, data):
|
||||
# Hosts will now power down ready for real activation in production
|
||||
sleep(30)
|
||||
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")
|
||||
|
@ -38,9 +38,6 @@ def send_webhook(config, status, message):
|
||||
|
||||
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
|
||||
body = config['notifications_body']
|
||||
formatted_body = dict()
|
||||
|
Loading…
x
Reference in New Issue
Block a user