From 4cdec3c46e7e7112cbcf2b0bf40e7682a5897a16 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 8 Nov 2013 16:45:20 -0500 Subject: [PATCH] Remove legacy check_output implementation for pre-2.7 Pythons. We still need it in integrations, because those don't require Python 2.7, but we don't need it in any of our code that runs on internal servers. (imported from commit 3c340567f1a372dcb4206c6af9a6e5e18005b1b8) --- bots/check-rabbitmq-consumers | 6 ++---- bots/check-rabbitmq-queue | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bots/check-rabbitmq-consumers b/bots/check-rabbitmq-consumers index d0103d3..fd3661b 100755 --- a/bots/check-rabbitmq-consumers +++ b/bots/check-rabbitmq-consumers @@ -5,9 +5,7 @@ import time import optparse from collections import defaultdict import os - -sys.path.append(os.path.join(os.path.dirname(__file__), '..')) -from zulip_tools import check_output +import subprocess states = { 0: "OK", @@ -35,7 +33,7 @@ parser.add_option('--min-threshold', (options, args) = parser.parse_args() -output = check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'], shell=False) +output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'], shell=False) consumers = defaultdict(int) diff --git a/bots/check-rabbitmq-queue b/bots/check-rabbitmq-queue index d29bc20..7f54d9f 100755 --- a/bots/check-rabbitmq-queue +++ b/bots/check-rabbitmq-queue @@ -4,9 +4,7 @@ import sys import re import time import os - -sys.path.append(os.path.join(os.path.dirname(__file__), '..')) -from zulip_tools import check_output +import subprocess WARN_THRESHOLD = 50 CRIT_THRESHOLD = 100 @@ -19,7 +17,7 @@ states = { } re = re.compile(r'(\w+)\t(\d+)') -output = check_output(['/usr/sbin/rabbitmqctl', 'list_queues'], shell=False) +output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_queues'], shell=False) status = 0 max_count = 0