From 04d73360f7ff8798e684284495fe4dc264f52c23 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Fri, 11 Nov 2016 11:57:07 +0100 Subject: [PATCH] Fix import of common libraries from Manila client Manila removed the copy of oslo inclubated code (following a global goal for Ocata) and this lead to some changes post-Newton. See: https://review.openstack.org/#/c/377604/ Change-Id: Ibda32791aa9b64966cd18daf001416e57a2c5e93 --- sahara/tests/unit/service/test_shares.py | 5 ++++- .../tests/unit/service/validation/test_share_validations.py | 5 ++++- sahara/utils/openstack/manila.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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