Merge pull request #7684 from s0undt3ch/develop

Some PEP8/Pylint fixes
This commit is contained in:
Joseph Hall 2013-10-08 18:11:00 -07:00
commit b8866dfb0a
4 changed files with 16 additions and 9 deletions

View File

@ -500,6 +500,7 @@ def policy_exists(vhost, name, runas=None):
policies = list_policies(runas=runas)
return bool(vhost in policies and name in policies[vhost])
def enable_plugin(name, runas=None):
'''
Enable a RabbitMQ plugin via the rabbitmq-plugin command.
@ -510,6 +511,7 @@ def enable_plugin(name, runas=None):
runas=runas)
return _format_response(ret, 'Enabled')
def disable_plugin(name, runas=None):
'''
Disable a RabbitMQ plugin via the rabbitmq-plugin command.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
'''
Manage RabbitMQ Clusters
@ -24,6 +25,7 @@ def __virtual__():
name = False
return name
def join(name, host, user='rabbit', runas=None):
'''
Ensure the RabbitMQ plugin is enabled.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
'''
Manage RabbitMQ Plugins.
@ -23,6 +24,7 @@ def __virtual__():
name = False
return name
def enabled(name, runas=None):
'''
Ensure the RabbitMQ plugin is enabled.
@ -50,6 +52,7 @@ def enabled(name, runas=None):
return ret
def disabled(name, runas=None):
'''
Ensure the RabbitMQ plugin is enabled.

View File

@ -34,11 +34,11 @@ def __virtual__():
def present(name,
password=None,
force=False,
tags=None,
perms={},
runas=None):
password=None,
force=False,
tags=None,
perms=(),
runas=None):
'''
Ensure the RabbitMQ user exists.
@ -81,9 +81,9 @@ def present(name,
if tags:
result = __salt__['rabbitmq.set_user_tags'](
name, tags, runas=runas)
for vhost, p in perms:
for vhost, perm in perms:
result = __salt__['rabbitmq.set_permissions'](
vhost, name, p[0], p[1], p[2], runas)
vhost, name, perm[0], perm[1], perm[2], runas)
elif force:
log.debug('User exists and force is set - Overriding')
if password is not None:
@ -97,9 +97,9 @@ def present(name,
result.update(__salt__['rabbitmq.set_user_tags'](
name, tags, runas=runas)
)
for vhost, p in perms:
for vhost, perm in perms:
result.update(__salt__['rabbitmq.set_permissions'](
vhost, name, p[0], p[1], p[2], runas)
vhost, name, perm[0], perm[1], perm[2], runas)
)
else:
log.debug('User exists, and force is not set - Abandoning')