univention udm_share: pep8

pull/18777/head
Tobias Rueetschi 8 years ago committed by Matt Clay
parent 8eb496989e
commit de34fdf681

@ -28,7 +28,6 @@ from ansible.module_utils.univention_umc import (
ldap_search,
base_dn,
)
import socket
DOCUMENTATION = '''
@ -484,9 +483,9 @@ def main():
module.params['printablename'] = '{} ({})'.format(name, module.params['host'])
for k in obj.keys():
if module.params[k] == True:
if module.params[k] is True:
module.params[k] = '1'
elif module.params[k] == False:
elif module.params[k] is False:
module.params[k] = '0'
obj[k] = module.params[k]
@ -502,9 +501,13 @@ def main():
obj.create()
elif changed:
obj.modify()
except Exception as e:
except BaseException as err:
module.fail_json(
msg='Creating/editing share {} in {} failed: {}'.format(name, container, e)
msg='Creating/editing share {} in {} failed: {}'.format(
name,
container,
err,
)
)
if state == 'absent' and exists:
@ -513,9 +516,13 @@ def main():
if not module.check_mode:
obj.remove()
changed = True
except:
except BaseException as err:
module.fail_json(
msg='Removing share {} in {} failed: {}'.format(name, container, e)
msg='Removing share {} in {} failed: {}'.format(
name,
container,
err,
)
)
module.exit_json(

Loading…
Cancel
Save