Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Remove dependency on scripts.lib.zulip_tools.

Alex Vandiver20eab264cf1a
diff --git a/puppet/zulip/files/nagios_plugins/zulip_postgresql/check_postgresql_replication_lag b/puppet/zulip/files/nagios_plugins/zulip_postgresql/check_postgresql_replication_lag
index 9517b64dc29..e3da831f3c9 100755
--- a/puppet/zulip/files/nagios_plugins/zulip_postgresql/check_postgresql_replication_lag
+++ b/puppet/zulip/files/nagios_plugins/zulip_postgresql/check_postgresql_replication_lag
@@ -4,14 +4,27 @@
replica PostgreSQL servers' xlog location. Requires that the user this
connects to PostgreSQL as has been granted the `pg_monitor` role.
+This can only use stdlib modules from python.
"""
+import configparser
import re
import subprocess
from typing import Dict, List
-from scripts.lib.zulip_tools import get_config, get_config_file
-config_file = get_config_file()
+def get_config(
+ config_file: configparser.RawConfigParser,
+ section: str,
+ key: str,
+ default_value: str = "",
+) -> str:
+ if config_file.has_option(section, key):
+ return config_file.get(section, key)
+ return default_value
+
+
+config_file = configparser.RawConfigParser()
+config_file.read("/etc/zulip/zulip.conf")
states = {
"OK": 0,