mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-09 18:51:29 -07:00
Not native, but text (#55676)
* use to_text instead of to_native * cleaned up some imports and other pyflakisms * fix missing lib messages
This commit is contained in:
parent
6e66ea9f78
commit
27dcf8aaab
12 changed files with 33 additions and 35 deletions
|
@ -72,7 +72,7 @@ validate_certs: False
|
|||
from distutils.version import LooseVersion
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_bytes, to_native
|
||||
from ansible.module_utils._text import to_bytes, to_native, to_text
|
||||
from ansible.module_utils.common._collections_compat import MutableMapping
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin, Cacheable, to_safe_group_name
|
||||
|
||||
|
@ -215,9 +215,9 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
|
|||
try:
|
||||
self.inventory.set_variable(host['name'], self.get_option('vars_prefix') + k, v)
|
||||
except ValueError as e:
|
||||
self.display.warning("Could not set host info hostvar for %s, skipping %s: %s" % (host, k, to_native(e)))
|
||||
self.display.warning("Could not set host info hostvar for %s, skipping %s: %s" % (host, k, to_text(e)))
|
||||
except ValueError as e:
|
||||
self.display.warning("Could not get host info for %s, skipping: %s" % (host['name'], to_native(e)))
|
||||
self.display.warning("Could not get host info for %s, skipping: %s" % (host['name'], to_text(e)))
|
||||
|
||||
# set host vars from params
|
||||
if self.get_option('want_params'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue