mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Bulk autopep8 (modules)
As agreed in 2017-12-07 Core meeting bulk fix pep8 issues Generated using: autopep8 1.3.3 (pycodestyle: 2.3.1) autopep8 -r --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules Manually fix issues that autopep8 has introduced
This commit is contained in:
parent
d13d7e9404
commit
c57a7f05e1
314 changed files with 3462 additions and 3383 deletions
|
@ -111,10 +111,10 @@ from ansible.module_utils.univention_umc import (
|
|||
def convert_time(time):
|
||||
"""Convert a time in seconds into the biggest unit"""
|
||||
units = [
|
||||
(24 * 60 * 60 , 'days'),
|
||||
(60 * 60 , 'hours'),
|
||||
(60 , 'minutes'),
|
||||
(1 , 'seconds'),
|
||||
(24 * 60 * 60, 'days'),
|
||||
(60 * 60, 'hours'),
|
||||
(60, 'minutes'),
|
||||
(1, 'seconds'),
|
||||
]
|
||||
|
||||
if time == 0:
|
||||
|
@ -126,49 +126,49 @@ def convert_time(time):
|
|||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
type = dict(required=True,
|
||||
type='str'),
|
||||
zone = dict(required=True,
|
||||
aliases=['name'],
|
||||
type='str'),
|
||||
nameserver = dict(default=[],
|
||||
type='list'),
|
||||
interfaces = dict(default=[],
|
||||
type='list'),
|
||||
refresh = dict(default=3600,
|
||||
type='int'),
|
||||
retry = dict(default=1800,
|
||||
type='int'),
|
||||
expire = dict(default=604800,
|
||||
type='int'),
|
||||
ttl = dict(default=600,
|
||||
type='int'),
|
||||
contact = dict(default='',
|
||||
type='str'),
|
||||
mx = dict(default=[],
|
||||
type='list'),
|
||||
state = dict(default='present',
|
||||
choices=['present', 'absent'],
|
||||
type='str')
|
||||
argument_spec=dict(
|
||||
type=dict(required=True,
|
||||
type='str'),
|
||||
zone=dict(required=True,
|
||||
aliases=['name'],
|
||||
type='str'),
|
||||
nameserver=dict(default=[],
|
||||
type='list'),
|
||||
interfaces=dict(default=[],
|
||||
type='list'),
|
||||
refresh=dict(default=3600,
|
||||
type='int'),
|
||||
retry=dict(default=1800,
|
||||
type='int'),
|
||||
expire=dict(default=604800,
|
||||
type='int'),
|
||||
ttl=dict(default=600,
|
||||
type='int'),
|
||||
contact=dict(default='',
|
||||
type='str'),
|
||||
mx=dict(default=[],
|
||||
type='list'),
|
||||
state=dict(default='present',
|
||||
choices=['present', 'absent'],
|
||||
type='str')
|
||||
),
|
||||
supports_check_mode=True,
|
||||
required_if = ([
|
||||
required_if=([
|
||||
('state', 'present', ['nameserver', 'interfaces'])
|
||||
])
|
||||
)
|
||||
type = module.params['type']
|
||||
zone = module.params['zone']
|
||||
nameserver = module.params['nameserver']
|
||||
interfaces = module.params['interfaces']
|
||||
refresh = module.params['refresh']
|
||||
retry = module.params['retry']
|
||||
expire = module.params['expire']
|
||||
ttl = module.params['ttl']
|
||||
contact = module.params['contact']
|
||||
mx = module.params['mx']
|
||||
state = module.params['state']
|
||||
changed = False
|
||||
type = module.params['type']
|
||||
zone = module.params['zone']
|
||||
nameserver = module.params['nameserver']
|
||||
interfaces = module.params['interfaces']
|
||||
refresh = module.params['refresh']
|
||||
retry = module.params['retry']
|
||||
expire = module.params['expire']
|
||||
ttl = module.params['ttl']
|
||||
contact = module.params['contact']
|
||||
mx = module.params['mx']
|
||||
state = module.params['state']
|
||||
changed = False
|
||||
|
||||
obj = list(ldap_search(
|
||||
'(&(objectClass=dNSZone)(zoneName={}))'.format(zone),
|
||||
|
@ -187,15 +187,15 @@ def main():
|
|||
obj = umc_module_for_add('dns/{}'.format(type), container)
|
||||
else:
|
||||
obj = umc_module_for_edit('dns/{}'.format(type), dn)
|
||||
obj['zone'] = zone
|
||||
obj['nameserver'] = nameserver
|
||||
obj['a'] = interfaces
|
||||
obj['refresh'] = convert_time(refresh)
|
||||
obj['retry'] = convert_time(retry)
|
||||
obj['expire'] = convert_time(expire)
|
||||
obj['ttl'] = convert_time(ttl)
|
||||
obj['contact'] = contact
|
||||
obj['mx'] = mx
|
||||
obj['zone'] = zone
|
||||
obj['nameserver'] = nameserver
|
||||
obj['a'] = interfaces
|
||||
obj['refresh'] = convert_time(refresh)
|
||||
obj['retry'] = convert_time(retry)
|
||||
obj['expire'] = convert_time(expire)
|
||||
obj['ttl'] = convert_time(ttl)
|
||||
obj['contact'] = contact
|
||||
obj['mx'] = mx
|
||||
diff = obj.diff()
|
||||
if exists:
|
||||
for k in obj.keys():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue