File prevent-ansiblegate-unit-tests-to-fail-on-ubuntu.patch of Package salt

From 73afbe5fe00c47427a032f8d94c113e1375e32ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
 <psuarezhernandez@suse.com>
Date: Mon, 8 Jul 2019 14:46:10 +0100
Subject: [PATCH] Prevent ansiblegate unit tests to fail on Ubuntu

---
 tests/unit/modules/test_ansiblegate.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/unit/modules/test_ansiblegate.py b/tests/unit/modules/test_ansiblegate.py
index b7b43efda4..05dff4a4fa 100644
--- a/tests/unit/modules/test_ansiblegate.py
+++ b/tests/unit/modules/test_ansiblegate.py
@@ -169,9 +169,11 @@ description:
             with patch('salt.utils.timed_subprocess.TimedProc', proc):
                 ret = _ansible_module_caller.call("one.two.three", "arg_1", kwarg1="foobar")
                 if six.PY3:
-                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": {"kwarg1": "foobar", "_raw_params": "arg_1"}}'], stdout=-1, timeout=1200)
                     proc.assert_any_call(['python3', 'foofile'], stdin=ANSIBLE_MODULE_ARGS, stdout=-1, timeout=1200)
                 else:
-                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": {"_raw_params": "arg_1", "kwarg1": "foobar"}}'], stdout=-1, timeout=1200)
                     proc.assert_any_call(['python', 'foofile'], stdin=ANSIBLE_MODULE_ARGS, stdout=-1, timeout=1200)
+                try:
+                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": {"kwarg1": "foobar", "_raw_params": "arg_1"}}'], stdout=-1, timeout=1200)
+                except AssertionError:
+                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": {"_raw_params": "arg_1", "kwarg1": "foobar"}}'], stdout=-1, timeout=1200)
                 assert ret == {"completed": True, "timeout": 1200}
-- 
2.16.4


openSUSE Build Service is sponsored by