Skip to content

Commit

Permalink
Pep8 fixes for opendj_backendprop_* (ansible#24587)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored and gundalow committed Jul 6, 2017
1 parent 437ee69 commit 3004c91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
14 changes: 6 additions & 8 deletions lib/ansible/modules/identity/opendj/opendj_backendprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@


class BackendProp(object):

def __init__(self, module):
self._module = module

Expand All @@ -118,7 +119,7 @@ def get_property(self, opendj_bindir, hostname, port, username, password_method,
else:
self._module.fail_json(msg="Error message: " + str(stderr))

def set_property(self, opendj_bindir, hostname, port, username, password_method, backend_name,name, value):
def set_property(self, opendj_bindir, hostname, port, username, password_method, backend_name, name, value):
my_command = [
opendj_bindir + '/dsconfig',
'set-backend-prop',
Expand Down Expand Up @@ -159,7 +160,9 @@ def main():
value=dict(required=True),
state=dict(default="present"),
),
supports_check_mode=True
supports_check_mode=True,
mutually_exclusive=[['password', 'passwordfile']],
required_one_of=[['password', 'passwordfile']]
)

opendj_bindir = module.params['opendj_bindir']
Expand All @@ -177,11 +180,6 @@ def main():
password_method = ['-w', password]
elif module.params["passwordfile"] is not None:
password_method = ['-j', passwordfile]
else:
module.fail_json(msg="No credentials are given. Use either 'password' or 'passwordfile'")

if module.params["passwordfile"] and module.params["password"]:
module.fail_json(msg="only one of 'password' or 'passwordfile' can be set")

opendj = BackendProp(module)
validate = opendj.get_property(opendj_bindir=opendj_bindir,
Expand Down Expand Up @@ -212,7 +210,7 @@ def main():
module.exit_json(changed=False)


from ansible.module_utils.basic import *
from ansible.module_utils.basic import AnsibleModule

if __name__ == '__main__':
main()
1 change: 0 additions & 1 deletion test/sanity/pep8/legacy-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ lib/ansible/modules/files/replace.py
lib/ansible/modules/files/synchronize.py
lib/ansible/modules/files/tempfile.py
lib/ansible/modules/files/xattr.py
lib/ansible/modules/identity/opendj/opendj_backendprop.py
lib/ansible/modules/messaging/rabbitmq_binding.py
lib/ansible/modules/messaging/rabbitmq_exchange.py
lib/ansible/modules/messaging/rabbitmq_parameter.py
Expand Down

0 comments on commit 3004c91

Please sign in to comment.