mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-09 18:51:29 -07:00
exoscale: pep8 and python3 fixes (#21821)
* exoscale: pep8 fixes * exo_dns_record: remove from pep8 test legacy * exoscale: fix python3 support
This commit is contained in:
parent
2ca5719168
commit
d26c57f938
4 changed files with 59 additions and 41 deletions
|
@ -184,8 +184,12 @@ exo_dns_domain:
|
|||
sample: false
|
||||
'''
|
||||
|
||||
# import exoscale common
|
||||
from ansible.module_utils.exoscale import *
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.exoscale import (
|
||||
ExoDns,
|
||||
exo_dns_argument_spec,
|
||||
exo_dns_required_together
|
||||
)
|
||||
|
||||
|
||||
class ExoDnsDomain(ExoDns):
|
||||
|
@ -252,8 +256,6 @@ def main():
|
|||
|
||||
module.exit_json(**result)
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -244,8 +244,30 @@ exo_dns_record:
|
|||
sample: "2016-08-12T15:24:23.989Z"
|
||||
'''
|
||||
|
||||
# import exoscale common
|
||||
from ansible.module_utils.exoscale import *
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.exoscale import (
|
||||
ExoDns,
|
||||
exo_dns_argument_spec,
|
||||
exo_dns_required_together
|
||||
)
|
||||
|
||||
EXO_RECORD_TYPES = [
|
||||
'A',
|
||||
'ALIAS',
|
||||
'CNAME',
|
||||
'MX',
|
||||
'SPF',
|
||||
'URL',
|
||||
'TXT',
|
||||
'NS',
|
||||
'SRV',
|
||||
'NAPTR',
|
||||
'PTR',
|
||||
'AAAA',
|
||||
'SSHFP',
|
||||
'HINFO',
|
||||
'POOL'
|
||||
]
|
||||
|
||||
|
||||
class ExoDnsRecord(ExoDns):
|
||||
|
@ -267,7 +289,6 @@ class ExoDnsRecord(ExoDns):
|
|||
if self.multiple and self.record_type != 'A':
|
||||
self.module.fail_json("Multiple is only usable with record_type A")
|
||||
|
||||
|
||||
def _create_record(self, record):
|
||||
self.result['changed'] = True
|
||||
data = {
|
||||
|
@ -357,7 +378,7 @@ def main():
|
|||
argument_spec = exo_dns_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name=dict(default=""),
|
||||
record_type=dict(choices=['A', 'ALIAS', 'CNAME', 'MX', 'SPF', 'URL', 'TXT', 'NS', 'SRV', 'NAPTR', 'PTR', 'AAAA', 'SSHFP', 'HINFO', 'POOL'], aliases=['rtype', 'type'], default='A'),
|
||||
record_type=dict(choices=EXO_RECORD_TYPES, aliases=['rtype', 'type'], default='A'),
|
||||
content=dict(aliases=['value', 'address']),
|
||||
multiple=(dict(type='bool', default=False)),
|
||||
ttl=dict(type='int', default=3600),
|
||||
|
@ -388,8 +409,6 @@ def main():
|
|||
result = exo_dns_record.get_result(resource)
|
||||
module.exit_json(**result)
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue