Merge "Magnum plugin: import exceptions robustly"
This commit is contained in:
commit
f2c03dd33f
@ -15,12 +15,17 @@
|
|||||||
import cfg
|
import cfg
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import magnumclient
|
|
||||||
from magnumclient import client
|
from magnumclient import client
|
||||||
from murano.common import auth_utils
|
from murano.common import auth_utils
|
||||||
from murano.dsl import session_local_storage
|
from murano.dsl import session_local_storage
|
||||||
from oslo_config import cfg as config
|
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
|
CONF = config.CONF
|
||||||
|
|
||||||
|
|
||||||
@ -85,5 +90,5 @@ class MagnumClient(object):
|
|||||||
self._wait_on_status(bays, bay_id, ["CREATE_COMPLETE",
|
self._wait_on_status(bays, bay_id, ["CREATE_COMPLETE",
|
||||||
"DELETE_IN_PROGRESS", "CREATE_FAILED"],
|
"DELETE_IN_PROGRESS", "CREATE_FAILED"],
|
||||||
["DELETE_COMPLETE"])
|
["DELETE_COMPLETE"])
|
||||||
except magnumclient.openstack.common.apiclient.exceptions.NotFound:
|
except exceptions.NotFound:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user