mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
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:
parent
df121d0cec
commit
098fb815af
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user