credstash lookup plugin: error out in run function when credstash not installed, not at module scope

pull/11778/head
Scott Cunningham 9 years ago
parent 934ce86d35
commit c4629b72e0

@ -29,13 +29,12 @@ except ImportError:
CREDSTASH_INSTALLED = False CREDSTASH_INSTALLED = False
if not CREDSTASH_INSTALLED:
raise AnsibleError('The credstash lookup plugin requires credstash to be installed.')
class LookupModule(LookupBase): class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs): 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): if isinstance(terms, basestring):
terms = [terms] terms = [terms]

Loading…
Cancel
Save