summaryrefslogtreecommitdiff
path: root/test/units/modules/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/modules/utils.py')
-rw-r--r--test/units/modules/utils.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/units/modules/utils.py b/test/units/modules/utils.py
index 6d169e36..b56229e8 100644
--- a/test/units/modules/utils.py
+++ b/test/units/modules/utils.py
@@ -6,14 +6,12 @@ import json
from units.compat import unittest
from units.compat.mock import patch
from ansible.module_utils import basic
-from ansible.module_utils._text import to_bytes
+from ansible.module_utils.common.text.converters import to_bytes
def set_module_args(args):
- if '_ansible_remote_tmp' not in args:
- args['_ansible_remote_tmp'] = '/tmp'
- if '_ansible_keep_remote_files' not in args:
- args['_ansible_keep_remote_files'] = False
+ args['_ansible_remote_tmp'] = '/tmp'
+ args['_ansible_keep_remote_files'] = False
args = json.dumps({'ANSIBLE_MODULE_ARGS': args})
basic._ANSIBLE_ARGS = to_bytes(args)
@@ -28,8 +26,6 @@ class AnsibleFailJson(Exception):
def exit_json(*args, **kwargs):
- if 'changed' not in kwargs:
- kwargs['changed'] = False
raise AnsibleExitJson(kwargs)