From d0aec6cd0636e6964dd9c660a1ceb91c0ab83e4b Mon Sep 17 00:00:00 2001 From: nhnn Date: Wed, 24 Jul 2024 06:12:18 +0300 Subject: [PATCH] fix: rename prometheus to monitoring --- selfprivacy_api/migrations/__init__.py | 4 ++-- .../{add_prometheus.py => add_monitoring.py} | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) rename selfprivacy_api/migrations/{add_prometheus.py => add_monitoring.py} (56%) diff --git a/selfprivacy_api/migrations/__init__.py b/selfprivacy_api/migrations/__init__.py index 5eb3194..327bb28 100644 --- a/selfprivacy_api/migrations/__init__.py +++ b/selfprivacy_api/migrations/__init__.py @@ -15,12 +15,12 @@ from selfprivacy_api.migrations.check_for_system_rebuild_jobs import ( CheckForSystemRebuildJobs, ) from selfprivacy_api.migrations.add_roundcube import AddRoundcube -from selfprivacy_api.migrations.add_prometheus import AddPrometheus +from selfprivacy_api.migrations.add_monitoring import AddMonitoring migrations = [ WriteTokenToRedis(), CheckForSystemRebuildJobs(), - AddPrometheus(), + AddMonitoring(), AddRoundcube(), ] diff --git a/selfprivacy_api/migrations/add_prometheus.py b/selfprivacy_api/migrations/add_monitoring.py similarity index 56% rename from selfprivacy_api/migrations/add_prometheus.py rename to selfprivacy_api/migrations/add_monitoring.py index 93089ff..a6dbfde 100644 --- a/selfprivacy_api/migrations/add_prometheus.py +++ b/selfprivacy_api/migrations/add_monitoring.py @@ -4,33 +4,33 @@ from selfprivacy_api.services.flake_service_manager import FlakeServiceManager from selfprivacy_api.utils import ReadUserData, WriteUserData -class AddPrometheus(Migration): - """Adds the Prometheus if it is not present.""" +class AddMonitoring(Migration): + """Adds monitoring service if it is not present.""" def get_migration_name(self) -> str: - return "add_prometheus" + return "add_monitoring" def get_migration_description(self) -> str: - return "Adds the Prometheus if it is not present." + return "Adds the Monitoring if it is not present." def is_migration_needed(self) -> bool: with FlakeServiceManager() as manager: - if "prometheus" not in manager.services: + if "monitoring" not in manager.services: return True with ReadUserData() as data: - if "prometheus" not in data["modules"]: + if "monitoring" not in data["modules"]: return True return False def migrate(self) -> None: with FlakeServiceManager() as manager: - if "prometheus" not in manager.services: + if "monitoring" not in manager.services: manager.services[ - "prometheus" - ] = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=flakes&dir=sp-modules/prometheus" + "monitoring" + ] = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=flakes&dir=sp-modules/monitoring" with WriteUserData() as data: - if "prometheus" not in data["modules"]: - data["modules"]["prometheus"] = { + if "monitoring" not in data["modules"]: + data["modules"]["monitoring"] = { "enable": False, - "subdomain": "prometheus", + "subdomain": "monitoring", }