Add remainder of notification webhooks

This commit is contained in:
2022-07-06 18:33:41 +00:00
parent 2674f3360c
commit d773ded73d
11 changed files with 51 additions and 2 deletions

View File

@ -23,6 +23,8 @@ import os
import sqlite3
import contextlib
import pvcbootstrapd.lib.notifications as notifications
from pvcbootstrapd.lib.dataclasses import Cluster, Node
from celery.utils.log import get_task_logger
@ -48,6 +50,7 @@ def init_database(config):
db_path = config["database_path"]
if not os.path.isfile(db_path):
print("First run: initializing database.")
notifications.send_webhook(config, "begin", "First run: initializing database")
# Initializing the database
with dbconn(db_path) as cur:
# Table listing all clusters
@ -73,6 +76,8 @@ def init_database(config):
CONSTRAINT cluster_col FOREIGN KEY (cluster) REFERENCES clusters(id) ON DELETE CASCADE )"""
)
notifications.send_webhook(config, "success", "First run: successfully initialized database")
#
# Cluster functions