Validate if "requests" are around. NOTE: this will be changed soon!

This commit is contained in:
Bo Maryniuk 2015-10-14 12:00:49 +02:00 committed by C. R. Oldham
parent 835e84181b
commit 13a8973f94

View file

@ -22,7 +22,14 @@ from __future__ import absolute_import
# Import python libs
import logging
import requests
# INFO: This is going to be removed anytime soon in favor of salt.utils.http
# But it needs a separate PR!
try:
import requests
except ImportError as err:
requests = None
import time
import json
from salt.exceptions import (CommandExecutionError, MinionError)
@ -56,7 +63,7 @@ def __virtual__():
'''
Validate the module.
'''
return True
return requests is not None
def init(cnf):