1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Bugfix: proper plugin configuration was reset

Before this patch, if config was ['/some/path'] then it would enter the
else block and config would be set to [].

The regression this patch fixes was introduced by 700db154.
This commit is contained in:
jpic 2016-04-05 11:58:35 +02:00
parent cca084c89d
commit da175d0a57
2 changed files with 5 additions and 1 deletions

View file

@ -66,7 +66,7 @@ class PluginLoader:
if config and not isinstance(config, list): if config and not isinstance(config, list):
config = [config] config = [config]
else: elif not config:
config = [] config = []
self.config = config self.config = config

View file

@ -75,3 +75,7 @@ class TestErrors(unittest.TestCase):
#with patch('glob.glob', mock_glob): #with patch('glob.glob', mock_glob):
# pass # pass
def test_plugin__config(self):
config = ['/one', '/two']
pl = PluginLoader('test', '', config, 'test_plugin')
self.assertEqual(pl.config, config)