mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Validate if "requests" are around. NOTE: this will be changed soon!
This commit is contained in:
parent
835e84181b
commit
13a8973f94
1 changed files with 9 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue