File fix-type-error-in-tornadoimporter.patch of Package salt.16131

From adf61956bbebeee3a64a6bfec81206bb2663ba13 Mon Sep 17 00:00:00 2001
From: "Daniel A. Wozniak" <dwozniak@saltstack.com>
Date: Sat, 8 Feb 2020 02:08:04 +0000
Subject: [PATCH] Fix type error in TornadoImporter

---
 salt/__init__.py       | 2 +-
 tests/unit/test_ext.py | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/salt/__init__.py b/salt/__init__.py
index 3e99d2439a..117523b1d2 100644
--- a/salt/__init__.py
+++ b/salt/__init__.py
@@ -12,7 +12,7 @@ import importlib
 
 class TornadoImporter(object):
 
-    def find_module(self, module_name, package_path):
+    def find_module(self, module_name, package_path=None):
         if module_name.startswith('tornado'):
             return self
         return None
diff --git a/tests/unit/test_ext.py b/tests/unit/test_ext.py
index 1cd8572086..3080147d9e 100644
--- a/tests/unit/test_ext.py
+++ b/tests/unit/test_ext.py
@@ -14,6 +14,7 @@ from tests.support.runtests import RUNTIME_VARS
 import tests.support.helpers
 
 # Import Salt libs
+import salt
 import salt.ext.six
 import salt.modules.cmdmod
 import salt.utils.platform
@@ -95,3 +96,10 @@ class VendorTornadoTest(TestCase):
             log.error("Test found bad line: %s", line)
             valid_lines.append(line)
         assert valid_lines == [], len(valid_lines)
+
+    def test_regression_56063(self):
+        importer = salt.TornadoImporter()
+        try:
+            importer.find_module('tornado')
+        except TypeError:
+            assert False, 'TornadoImporter raised type error when one argument passed'
-- 
2.27.0


openSUSE Build Service is sponsored by