diff --git a/lib/ansible/plugins/__init__.py b/lib/ansible/plugins/__init__.py index c10d19cd38..03558df986 100644 --- a/lib/ansible/plugins/__init__.py +++ b/lib/ansible/plugins/__init__.py @@ -66,7 +66,7 @@ class PluginLoader: if config and not isinstance(config, list): config = [config] - else: + elif not config: config = [] self.config = config diff --git a/test/units/plugins/test_plugins.py b/test/units/plugins/test_plugins.py index 76a2600f53..3543cbc230 100644 --- a/test/units/plugins/test_plugins.py +++ b/test/units/plugins/test_plugins.py @@ -75,3 +75,7 @@ class TestErrors(unittest.TestCase): #with patch('glob.glob', mock_glob): # pass + def test_plugin__config(self): + config = ['/one', '/two'] + pl = PluginLoader('test', '', config, 'test_plugin') + self.assertEqual(pl.config, config)