Update rabbitmctl usage to rabbitmq 2.6 (precise) (LP: #900440)

This commit is contained in:
Adam Gandelman 2011-12-05 11:55:29 -08:00
parent b13b20effb
commit a4bc59a803
2 changed files with 4 additions and 4 deletions

View File

@ -23,11 +23,11 @@ HOSTNAME=`hostname -f`
ERLANG_COOKIE="/var/lib/rabbitmq/.erlang.cookie"
function user_exists {
$RABBIT_CTL list_users | grep $1 >/dev/null
$RABBIT_CTL list_users | grep -wq "^$1"
}
function user_is_admin {
$RABBIT_CTL list_users | grep $1 | grep true >/dev/null
$RABBIT_CTL list_users | grep -w "^$1" | grep -q "administrator"
}
function vhost_exists {
@ -51,6 +51,6 @@ function user_create {
if [[ $2 == 'admin' ]] ; then
user_is_admin $1 && return 0
juju-log "rabbitmq: Granting user $1 admin access"
$RABBIT_CTL set_admin $1 || return 1
$RABBIT_CTL set_user_tags "$1" administrator || return 1
fi
}

View File

@ -1 +1 @@
46
47