mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because of licensing. So once created it we had two sets of functions that did the same things but had different implementations. To remedy that, this change removes the ansible.utils.unicode versions of those functions.
This commit is contained in:
@@ -20,10 +20,10 @@ __metaclass__ = type
|
||||
|
||||
import os
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.plugins.action import ActionBase
|
||||
from ansible.utils.boolean import boolean
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.utils.unicode import to_str
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
@@ -52,7 +52,7 @@ class ActionModule(ActionBase):
|
||||
src = self._find_needle('files', src)
|
||||
except AnsibleError as e:
|
||||
result['failed'] = True
|
||||
result['msg'] = to_str(e)
|
||||
result['msg'] = to_native(e)
|
||||
return result
|
||||
|
||||
# create the remote tmp dir if needed, and put the source file there
|
||||
|
||||
Reference in New Issue
Block a user