Use the -q argument to strip extraneous messages from rabbitmq

Instead of trying to do it ourselves and worrying about which
version prints 'Listing vhosts...' and '...done' at the beginning
or end of the output or not.

Fixes #26592
This commit is contained in:
rallytime 2015-11-06 17:20:10 -07:00
parent df121d0cec
commit 098fb815af

View File

@ -128,11 +128,9 @@ def list_vhosts(runas=None):
''' '''
if runas is None: if runas is None:
runas = salt.utils.get_user() runas = salt.utils.get_user()
res = __salt__['cmd.run']('rabbitmqctl list_vhosts', res = __salt__['cmd.run']('rabbitmqctl list_vhosts -q',
runas=runas) runas=runas).splitlines()
return res
# remove first and last line: Listing ... - ...done
return _strip_listing_to_done(res.splitlines())
def user_exists(name, runas=None): def user_exists(name, runas=None):