[cloud] ec2_elb_lb module Python 3 fix for string types (#24925)
* Python 3 compatibility for ec2_elb_lb module * Use string_types from ansible.module_utils.six for python2/3 compatibility
This commit is contained in:
parent
0e0c5328fa
commit
2ee2c8c1ab
1 changed files with 2 additions and 1 deletions
|
@ -412,6 +412,7 @@ import random
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.ec2 import ec2_argument_spec, connect_to_aws, AnsibleAWSError
|
||||
from ansible.module_utils.ec2 import get_aws_connection_info
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
|
||||
def _throttleable_operation(max_retries):
|
||||
|
@ -1332,7 +1333,7 @@ def main():
|
|||
grp_details = ec2.get_all_security_groups(filters=filters)
|
||||
|
||||
for group_name in security_group_names:
|
||||
if isinstance(group_name, basestring):
|
||||
if isinstance(group_name, string_types):
|
||||
group_name = [group_name]
|
||||
|
||||
group_id = [ str(grp.id) for grp in grp_details if str(grp.name) in group_name ]
|
||||
|
|
Loading…
Reference in a new issue