Commit 193e857b by Scott Cunningham

credstash lookup plugin: raise AnsibleError when credstash library not installed

parent 695e456c
......@@ -20,7 +20,17 @@ __metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
import credstash
CREDSTASH_INSTALLED = False
try:
import credstash
CREDSTASH_INSTALLED = True
except ImportError:
CREDSTASH_INSTALLED = False
if not CREDSTASH_INSTALLED:
raise AnsibleError('The credstash lookup plugin requires credstash to be installed.')
class LookupModule(LookupBase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment