1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

credstash lookup plugin: raise AnsibleError when credstash library not installed

This commit is contained in:
Scott Cunningham 2015-07-30 21:04:26 +01:00
parent 695e456cb0
commit 193e857bc4

View file

@ -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):