mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-18 14:21:06 -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
|
@ -27,7 +27,7 @@ EXAMPLES = r'''
|
|||
import os
|
||||
|
||||
from ansible.errors import AnsibleError, AnsibleParserError
|
||||
from ansible.module_utils._text import to_bytes, to_native
|
||||
from ansible.module_utils._text import to_bytes, to_native, to_text
|
||||
from ansible.parsing.utils.addresses import parse_address
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin
|
||||
|
||||
|
@ -56,7 +56,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||
try:
|
||||
(host, port) = parse_address(h, allow_ranges=False)
|
||||
except AnsibleError as e:
|
||||
self.display.vvv("Unable to parse address from hostname, leaving unchanged: %s" % to_native(e))
|
||||
self.display.vvv("Unable to parse address from hostname, leaving unchanged: %s" % to_text(e))
|
||||
host = h
|
||||
port = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue