Merge pull request #6421 from terminalmage/issue6338

rabbitmq: quote passwd when adding user/changing passwd
This commit is contained in:
Pedro Algarvio 2013-07-29 18:07:40 -07:00
commit 76f2b31e70

View File

@ -103,7 +103,7 @@ def add_user(name, password, runas=None):
salt '*' rabbitmq.add_user rabbit_user password salt '*' rabbitmq.add_user rabbit_user password
''' '''
res = __salt__['cmd.run']( res = __salt__['cmd.run'](
'rabbitmqctl add_user {0} {1}'.format(name, password), 'rabbitmqctl add_user {0} \'{1}\''.format(name, password),
runas=runas) runas=runas)
msg = 'Added' msg = 'Added'
@ -134,7 +134,7 @@ def change_password(name, password, runas=None):
salt '*' rabbitmq.change_password rabbit_user password salt '*' rabbitmq.change_password rabbit_user password
''' '''
res = __salt__['cmd.run']( res = __salt__['cmd.run'](
'rabbitmqctl change_password {0} {1}'.format(name, password), 'rabbitmqctl change_password {0} \'{1}\''.format(name, password),
runas=runas) runas=runas)
msg = 'Password Changed' msg = 'Password Changed'
@ -215,7 +215,8 @@ def list_user_permissions(name, user=None):
runas=user) runas=user)
return [r.split('\t') for r in res.splitlines()] return [r.split('\t') for r in res.splitlines()]
def status(name, user=None):
def status(user=None):
''' '''
return rabbitmq status return rabbitmq status
@ -225,9 +226,11 @@ def status(name, user=None):
''' '''
res = __salt__['cmd.run']( res = __salt__['cmd.run'](
'rabbitmqctl status', 'rabbitmqctl status',
runas=user) runas=user
)
return res return res
def cluster_status(user=None): def cluster_status(user=None):
''' '''
return rabbitmq cluster_status return rabbitmq cluster_status
@ -243,6 +246,7 @@ def cluster_status(user=None):
return res return res
def stop_app(runas=None): def stop_app(runas=None):
''' '''
Stops the RabbitMQ application, leaving the Erlang node running. Stops the RabbitMQ application, leaving the Erlang node running.
@ -257,6 +261,7 @@ def stop_app(runas=None):
return res return res
def start_app(runas=None): def start_app(runas=None):
''' '''
Start the RabbitMQ application. Start the RabbitMQ application.
@ -271,6 +276,7 @@ def start_app(runas=None):
return res return res
def reset(runas=None): def reset(runas=None):
''' '''
Return a RabbitMQ node to its virgin state Return a RabbitMQ node to its virgin state
@ -285,6 +291,7 @@ def reset(runas=None):
return res return res
def force_reset(runas=None): def force_reset(runas=None):
''' '''
Forcefully Return a RabbitMQ node to its virgin state Forcefully Return a RabbitMQ node to its virgin state