diff --git a/lib/ansible/plugins/lookup/credstash.py b/lib/ansible/plugins/lookup/credstash.py index febccfa5c6..5b4a0c0c40 100644 --- a/lib/ansible/plugins/lookup/credstash.py +++ b/lib/ansible/plugins/lookup/credstash.py @@ -29,13 +29,12 @@ except ImportError: CREDSTASH_INSTALLED = False -if not CREDSTASH_INSTALLED: - raise AnsibleError('The credstash lookup plugin requires credstash to be installed.') - - class LookupModule(LookupBase): def run(self, terms, variables, **kwargs): + if not CREDSTASH_INSTALLED: + raise AnsibleError('The credstash lookup plugin requires credstash to be installed.') + if isinstance(terms, basestring): terms = [terms]