Merge pull request #28081 from The-Loeki/fix-trace-on-keystone-state

fix for glance state trace error on import failure
This commit is contained in:
Mike Place 2015-10-19 06:08:47 -06:00
commit 2ac8fd793d

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