The plugin has been written by
# (c) 2013, Serge van Ginderachter <serge@xxxx>
#
# This file is part of Ansible
It begins like this:
import ansible.utils as utils
import ansible.errors as errors
class LookupModule(object):
def __init__(self, basedir=None, **kwargs):
self.basedir = basedir
def run(self, terms, inject=None, **kwargs):
terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject)
terms[0] = utils.listify_lookup_plugin_terms(terms[0], self.basedir, inject)
When running it in ansible 1.7, things work as expected.
While running it in ansbile 2.1,
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/work/github/berkin/ansible-2.0/lib/ansible/executor/task_executor.py", line 91, in run
items = self._get_loop_items()
File "/work/github/berkin/ansible-2.0/lib/ansible/executor/task_executor.py", line 191, in _get_loop_items
items = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar).run(terms=loop_terms, variables=self._job_vars)
AttributeError: 'NoneType' object has no attribute 'run'
fatal: [devtest]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}