mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix for glance state trace error on import failure
This commit is contained in:
parent
a2128c8f80
commit
258e11f754
1 changed files with 15 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue