python: Normalize quotes with Black.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:20:45 -08:00
committed by Tim Abbott
parent 11741543da
commit 6e4c3e41dc
989 changed files with 32792 additions and 32792 deletions

View File

@@ -19,14 +19,14 @@ states = {
3: "UNKNOWN",
}
if 'USER' in os.environ and not os.environ['USER'] in ['root', 'rabbitmq']:
if "USER" in os.environ and not os.environ["USER"] in ["root", "rabbitmq"]:
print("This script must be run as the root or rabbitmq user")
usage = """Usage: check-rabbitmq-consumers --queue=[queue-name] --min-threshold=[min-threshold]"""
parser = argparse.ArgumentParser(usage=usage)
parser.add_argument('--min-threshold', dest='min_count', type=int, default=1)
parser.add_argument("--min-threshold", dest="min_count", type=int, default=1)
options = parser.parse_args()
@@ -34,7 +34,7 @@ config_file = get_config_file()
TORNADO_PROCESSES = len(get_tornado_ports(config_file))
output = subprocess.check_output(
['/usr/sbin/rabbitmqctl', 'list_consumers'], universal_newlines=True
["/usr/sbin/rabbitmqctl", "list_consumers"], universal_newlines=True
)
consumers: Dict[str, int] = defaultdict(int)
@@ -42,15 +42,15 @@ consumers: Dict[str, int] = defaultdict(int)
queues = {
*normal_queues,
# These queues may not be present if settings.TORNADO_PROCESSES > 1
'notify_tornado',
"notify_tornado",
}
for queue_name in queues:
queue_name = queue_name.strip()
consumers[queue_name] = 0
for line in output.split('\n'):
parts = line.split('\t')
for line in output.split("\n"):
parts = line.split("\t")
if len(parts) >= 2:
queue_name = parts[0]
if queue_name.startswith("notify_tornado_"):