fix for glance state trace error on import failure

This commit is contained in:
Ronald van Zantvoort 2015-10-19 12:44:02 +02:00
parent a2128c8f80
commit 258e11f754

View file

@ -12,14 +12,25 @@ import time
from salt.utils import warn_until
# Import OpenStack libs
from keystoneclient.apiclient.exceptions import \
Unauthorized as kstone_Unauthorized
from glanceclient.exc import \
HTTPUnauthorized as glance_Unauthorized
try:
from keystoneclient.apiclient.exceptions import \
Unauthorized as kstone_Unauthorized
from glanceclient.exc import \
HTTPUnauthorized as glance_Unauthorized
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
log = logging.getLogger(__name__)
def __virtual__():
'''
Only load if dependencies are loaded
'''
return HAS_DEPENDENCIES
def _find_image(name):
'''
Tries to find image with given name, returns