mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +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:
@@ -25,9 +25,10 @@ import smtplib
|
||||
import json
|
||||
|
||||
from ansible.compat.six import string_types
|
||||
from ansible.utils.unicode import to_bytes
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
|
||||
def mail(subject='Ansible error mail', sender=None, to=None, cc=None, bcc=None, body=None, smtphost=None):
|
||||
|
||||
if sender is None:
|
||||
@@ -84,7 +85,7 @@ class CallbackModule(CallbackBase):
|
||||
if ignore_errors:
|
||||
return
|
||||
sender = '"Ansible: %s" <root>' % host
|
||||
attach = res._task.action
|
||||
attach = res._task.action
|
||||
if 'invocation' in res._result:
|
||||
attach = "%s: %s" % (res._result['invocation']['module_name'], json.dumps(res._result['invocation']['module_args']))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user