Merge "Magnum plugin: import exceptions robustly"

This commit is contained in:
Jenkins 2016-06-09 00:04:47 +00:00 committed by Gerrit Code Review
commit f2c03dd33f

View File

@ -15,12 +15,17 @@
import cfg
import time
import magnumclient
from magnumclient import client
from murano.common import auth_utils
from murano.dsl import session_local_storage
from oslo_config import cfg as config
try:
from magnumclient.common.apiclient import exceptions
except ImportError:
# NOTE (hongbin): For magnumclient versions before 2.0.0.
from magnumclient.openstack.common.apiclient import exceptions
CONF = config.CONF
@ -85,5 +90,5 @@ class MagnumClient(object):
self._wait_on_status(bays, bay_id, ["CREATE_COMPLETE",
"DELETE_IN_PROGRESS", "CREATE_FAILED"],
["DELETE_COMPLETE"])
except magnumclient.openstack.common.apiclient.exceptions.NotFound:
except exceptions.NotFound:
pass