Don't let Salt fail because libcloud is not installed.

This commit is contained in:
Pedro Algarvio 2013-11-10 08:38:06 +00:00
parent 865b009e1e
commit 0e9b977384

View File

@ -28,7 +28,11 @@ import salt.cloud
import salt.cloud.config
from salt.cloud.utils import parsers
from salt.cloud.exceptions import SaltCloudException, SaltCloudSystemExit
from salt.cloud.libcloudfuncs import libcloud_version
try:
from salt.cloud.libcloudfuncs import libcloud_version
HAS_LIBCLOUD = True
except ImportError:
HAS_LIBCLOUD = False
log = logging.getLogger(__name__)
@ -39,6 +43,9 @@ class SaltCloud(parsers.SaltCloudParser):
'''
Execute the salt-cloud command line
'''
if HAS_LIBCLOUD is False:
self.error('salt-cloud requires >= libcloud 0.11.4')
libcloud_version()
# Parse shell arguments