Skip to content

Commit

Permalink
Bugfix: proper plugin configuration was reset
Browse files Browse the repository at this point in the history
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 700db15.
  • Loading branch information
jpic committed Apr 5, 2016
1 parent cca084c commit da175d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/units/plugins/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit da175d0

Please sign in to comment.