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.

check_send_receive_time: Move "states" to inside where they are used.

Alex Vandiver8bdf1e4a1057
diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time
index 54893513df5..d47344e5a57 100755
--- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time
+++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time
@@ -45,15 +45,15 @@ parser.add_argument("--insecure", action="store_true")
options = parser.parse_args()
-states = {
- "OK": 0,
- "WARNING": 1,
- "CRITICAL": 2,
- "UNKNOWN": 3,
-}
-
def report(state: str, timestamp: Any = None, msg: Optional[str] = None) -> NoReturn:
+ states = {
+ "OK": 0,
+ "WARNING": 1,
+ "CRITICAL": 2,
+ "UNKNOWN": 3,
+ }
+
now = int(time.time())
if msg is None:
msg = f"send time was {timestamp}"