mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Fix modules' use of BOOLEANS*
* The canonical location of BOOLEANS has moved. Switch imports to use that. * clean up argument_spec use of booleans. * Clean up imports to not use wildcards * Remove usage of get_exception
This commit is contained in:
parent
ff22528b07
commit
d64e291274
17 changed files with 98 additions and 102 deletions
|
@ -146,7 +146,6 @@ from ansible.module_utils.f5_utils import (
|
|||
iteritems,
|
||||
defaultdict
|
||||
)
|
||||
from ansible.module_utils.basic import BOOLEANS
|
||||
|
||||
|
||||
class Parameters(AnsibleF5Parameters):
|
||||
|
|
|
@ -118,6 +118,10 @@ try:
|
|||
except ImportError:
|
||||
HAS_F5SDK = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ec2 import camel_dict_to_snake_dict
|
||||
from ansible.module_utils.f5_utils import F5ModuleError, f5_argument_spec
|
||||
|
||||
|
||||
class BigIpGtmDatacenter(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -346,7 +350,7 @@ def main():
|
|||
meta_args = dict(
|
||||
contact=dict(required=False, default=None),
|
||||
description=dict(required=False, default=None),
|
||||
enabled=dict(required=False, type='bool', default=None, choices=BOOLEANS),
|
||||
enabled=dict(required=False, type='bool', default=None),
|
||||
location=dict(required=False, default=None),
|
||||
name=dict(required=True)
|
||||
)
|
||||
|
@ -365,9 +369,6 @@ def main():
|
|||
except F5ModuleError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.ec2 import camel_dict_to_snake_dict
|
||||
from ansible.module_utils.f5_utils import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -118,7 +118,15 @@ RETURN = '''
|
|||
import re
|
||||
import uuid
|
||||
|
||||
from ansible.module_utils.basic import BOOLEANS
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
from f5.utils.iapp_parser import (
|
||||
NonextantTemplateNameException
|
||||
)
|
||||
|
||||
from ansible.module_utils.f5_utils import (
|
||||
AnsibleF5Client,
|
||||
AnsibleF5Parameters,
|
||||
|
@ -128,14 +136,6 @@ from ansible.module_utils.f5_utils import (
|
|||
defaultdict,
|
||||
iControlUnexpectedHTTPError
|
||||
)
|
||||
from f5.utils.iapp_parser import (
|
||||
NonextantTemplateNameException
|
||||
)
|
||||
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
|
||||
class Parameters(AnsibleF5Parameters):
|
||||
|
@ -453,7 +453,6 @@ class ArgumentSpec(object):
|
|||
choices=['present', 'absent']
|
||||
),
|
||||
force=dict(
|
||||
choices=BOOLEANS,
|
||||
type='bool'
|
||||
),
|
||||
content=dict()
|
||||
|
|
|
@ -138,6 +138,10 @@ try:
|
|||
except ImportError:
|
||||
HAS_NETADDR = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ec2 import camel_dict_to_snake_dict
|
||||
from ansible.module_utils.f5_utils import F5ModuleError, f5_argument_spec
|
||||
|
||||
|
||||
class BigIpSnatPoolManager(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -363,7 +367,6 @@ class BigIpSnatPoolModuleConfig(object):
|
|||
append=dict(
|
||||
default=False,
|
||||
type='bool',
|
||||
choices=BOOLEANS
|
||||
),
|
||||
name=dict(required=True),
|
||||
members=dict(
|
||||
|
@ -410,9 +413,6 @@ def main():
|
|||
except F5ModuleError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.ec2 import camel_dict_to_snake_dict
|
||||
from ansible.module_utils.f5_utils import *
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -196,8 +196,6 @@ try:
|
|||
except ImportError:
|
||||
HAS_NETADDR = False
|
||||
|
||||
from ansible.module_utils.basic import BOOLEANS_TRUE
|
||||
from ansible.module_utils.basic import BOOLEANS_FALSE
|
||||
from ansible.module_utils.f5_utils import (
|
||||
AnsibleF5Client,
|
||||
AnsibleF5Parameters,
|
||||
|
@ -205,6 +203,7 @@ from ansible.module_utils.f5_utils import (
|
|||
F5ModuleError,
|
||||
iControlUnexpectedHTTPError
|
||||
)
|
||||
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE, BOOLEANS_TRUE
|
||||
|
||||
|
||||
class Parameters(AnsibleF5Parameters):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue