mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-06 00:14:02 -07:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
parent
9f7b0dfc30
commit
225fa5d092
84 changed files with 652 additions and 963 deletions
|
@ -240,12 +240,24 @@ EXAMPLES = '''
|
|||
register: rax
|
||||
'''
|
||||
|
||||
import os
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
|
||||
try:
|
||||
import pyrax
|
||||
HAS_PYRAX = True
|
||||
except ImportError:
|
||||
HAS_PYRAX = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.rax import (FINAL_STATUSES, rax_argument_spec, rax_find_bootable_volume,
|
||||
rax_find_image, rax_find_network, rax_find_volume,
|
||||
rax_required_together, rax_to_dict, setup_rax_module)
|
||||
from ansible.module_utils.six.moves import xrange
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
|
||||
def rax_find_server_image(module, server, image, boot_volume):
|
||||
if not image and boot_volume:
|
||||
|
@ -515,7 +527,7 @@ def cloudservers(module, state=None, name=None, flavor=None, image=None,
|
|||
meta[k] = ','.join(['%s' % i for i in v])
|
||||
elif isinstance(v, dict):
|
||||
meta[k] = json.dumps(v)
|
||||
elif not isinstance(v, basestring):
|
||||
elif not isinstance(v, string_types):
|
||||
meta[k] = '%s' % v
|
||||
|
||||
# When using state=absent with group, the absent block won't match the
|
||||
|
@ -890,11 +902,5 @@ def main():
|
|||
boot_volume_terminate=boot_volume_terminate)
|
||||
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.rax import *
|
||||
|
||||
# invoke the module
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue