diff --git a/sahara/tests/unit/service/test_shares.py b/sahara/tests/unit/service/test_shares.py index cc5f1fea..71a7c642 100644 --- a/sahara/tests/unit/service/test_shares.py +++ b/sahara/tests/unit/service/test_shares.py @@ -14,7 +14,10 @@ # limitations under the License. -from manilaclient.openstack.common.apiclient import exceptions as manila_ex +try: + from manilaclient.common.apiclient import exceptions as manila_ex +except ImportError: + from manilaclient.openstack.common.apiclient import exceptions as manila_ex import mock from oslo_utils import uuidutils import testtools diff --git a/sahara/tests/unit/service/validation/test_share_validations.py b/sahara/tests/unit/service/validation/test_share_validations.py index 674a7e15..f4296170 100644 --- a/sahara/tests/unit/service/validation/test_share_validations.py +++ b/sahara/tests/unit/service/validation/test_share_validations.py @@ -13,7 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from manilaclient.openstack.common.apiclient import exceptions as manila_ex +try: + from manilaclient.common.apiclient import exceptions as manila_ex +except ImportError: + from manilaclient.openstack.common.apiclient import exceptions as manila_ex import mock from sahara.service.validations import shares diff --git a/sahara/utils/openstack/manila.py b/sahara/utils/openstack/manila.py index f0afaf36..fbf08ba2 100644 --- a/sahara/utils/openstack/manila.py +++ b/sahara/utils/openstack/manila.py @@ -14,7 +14,10 @@ # limitations under the License. import manilaclient.client as manila_client -from manilaclient.openstack.common.apiclient import exceptions as manila_ex +try: + from manilaclient.common.apiclient import exceptions as manila_ex +except ImportError: + from manilaclient.openstack.common.apiclient import exceptions as manila_ex from oslo_config import cfg from sahara import context