mirror of https://github.com/zulip/zulip.git
check-rabbitmq-queue: Put user check before rabbitmqctl call.
This commit is contained in:
parent
5da2f80140
commit
ea93810d9a
|
@ -32,15 +32,15 @@ states = {
|
|||
}
|
||||
|
||||
pattern = re.compile(r'(\w+)\t(\d+)')
|
||||
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")
|
||||
|
||||
output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_queues'], universal_newlines=True)
|
||||
|
||||
status = 0
|
||||
max_count = 0
|
||||
warn_queues = []
|
||||
|
||||
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")
|
||||
|
||||
for line in output.split("\n"):
|
||||
line = line.strip()
|
||||
m = pattern.match(line)
|
||||
|
|
Loading…
Reference in New Issue