mirror of https://github.com/zulip/zulip.git
scripts: Replace optparse with argparse.
This commit is contained in:
parent
5f6dbe6226
commit
54fb88f331
|
@ -2,7 +2,7 @@
|
|||
|
||||
import sys
|
||||
import time
|
||||
import optparse
|
||||
import argparse
|
||||
from collections import defaultdict
|
||||
import os
|
||||
import subprocess
|
||||
|
@ -23,14 +23,14 @@ if 'USER' in os.environ and not os.environ['USER'] in ['root', 'rabbitmq']:
|
|||
|
||||
usage = """Usage: check-rabbitmq-consumers --queue=[queue-name] --min-threshold=[min-threshold]"""
|
||||
|
||||
parser = optparse.OptionParser(usage=usage)
|
||||
parser.add_option('--min-threshold',
|
||||
dest='min_count',
|
||||
type="int",
|
||||
default=1,
|
||||
action='store')
|
||||
parser = argparse.ArgumentParser(usage=usage)
|
||||
parser.add_argument('--min-threshold',
|
||||
dest='min_count',
|
||||
type=int,
|
||||
default=1,
|
||||
action='store')
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
options = parser.parse_args()
|
||||
|
||||
output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'],
|
||||
universal_newlines=True)
|
||||
|
|
Loading…
Reference in New Issue