From b76417d1122ab234741fc4ee3f76728ec61e9fe6 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 22 Mar 2013 16:05:44 -0400 Subject: [PATCH] Check for USER env var before accessing it (imported from commit 6274eeee98026701bafc55b919fe9354536a413b) --- bots/check-rabbitmq-queue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/check-rabbitmq-queue b/bots/check-rabbitmq-queue index ae77951c93..95513cfe2e 100755 --- a/bots/check-rabbitmq-queue +++ b/bots/check-rabbitmq-queue @@ -27,7 +27,7 @@ status = 0 max_count = 0 warn_queues = [] -if not environ['USER'] in ['root', 'rabbitmq']: +if 'USER' in environ and not environ['USER'] in ['root', 'rabbitmq']: print "This script must be run as the root or rabbitmq user" for line in output.split("\n"):