diff --git a/lib/ansible/plugins/__init__.py b/lib/ansible/plugins/__init__.py index c10d19cd384e80..03558df986d099 100644 --- a/lib/ansible/plugins/__init__.py +++ b/lib/ansible/plugins/__init__.py @@ -66,7 +66,7 @@ def __init__(self, class_name, package, config, subdir, aliases={}, required_bas 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 76a2600f53bdc3..3543cbc230cf42 100644 --- a/test/units/plugins/test_plugins.py +++ b/test/units/plugins/test_plugins.py @@ -75,3 +75,7 @@ def test_plugins__get_paths(self): #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)