mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Migrate basestring to a python3 compatible type (#17199)
This commit is contained in:
parent
a695e18615
commit
a22909c226
28 changed files with 137 additions and 101 deletions
|
@ -18,13 +18,12 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.compat.six import iteritems
|
||||
from ansible.compat.six import iteritems, string_types
|
||||
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.utils.boolean import boolean
|
||||
from ansible.utils.vars import isidentifier
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
|
||||
TRANSFERS_FILES = False
|
||||
|
@ -45,7 +44,7 @@ class ActionModule(ActionBase):
|
|||
result['msg'] = "The variable name '%s' is not valid. Variables must start with a letter or underscore character, and contain only letters, numbers and underscores." % k
|
||||
return result
|
||||
|
||||
if isinstance(v, basestring) and v.lower() in ('true', 'false', 'yes', 'no'):
|
||||
if isinstance(v, string_types) and v.lower() in ('true', 'false', 'yes', 'no'):
|
||||
v = boolean(v)
|
||||
facts[k] = v
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue