diff --git a/heat/engine/clients/os/manila.py b/heat/engine/clients/os/manila.py index 74efab3717..8076a8b825 100644 --- a/heat/engine/clients/os/manila.py +++ b/heat/engine/clients/os/manila.py @@ -11,13 +11,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_utils import importutils - from heat.engine.clients import client_plugin +from manilaclient import client as manila_client +from manilaclient import exceptions -exceptions = importutils.try_import( - 'manilaclient.openstack.common.apiclient.exceptions') -manila_client = importutils.try_import('manilaclient.v1.client') +MANILACLIENT_VERSION = "1" class ManilaClientPlugin(client_plugin.ClientPlugin): @@ -36,7 +34,7 @@ class ManilaClientPlugin(client_plugin.ClientPlugin): 'input_auth_token': self.auth_token } - client = manila_client.Client(**args) + client = manila_client.Client(MANILACLIENT_VERSION, **args) return client def is_not_found(self, ex): diff --git a/heat/tests/test_manila_client.py b/heat/tests/test_manila_client.py index 917f72310a..0d3de13180 100644 --- a/heat/tests/test_manila_client.py +++ b/heat/tests/test_manila_client.py @@ -11,18 +11,12 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_utils import importutils -import testtools - from heat.tests import common from heat.tests import utils -manila_client = importutils.try_import('manilaclient.v1.client') - class ManilaClientPluginTests(common.HeatTestCase): - @testtools.skipIf(manila_client is None, 'Tests the manila client') def test_create(self): context = utils.dummy_context() plugin = context.clients.client_plugin('manila') diff --git a/heat/tests/test_manila_security_service.py b/heat/tests/test_manila_security_service.py index 38d033702f..bd70ec20b1 100644 --- a/heat/tests/test_manila_security_service.py +++ b/heat/tests/test_manila_security_service.py @@ -12,9 +12,7 @@ # under the License. import mock -from oslo_utils import importutils import six -import testtools from heat.common import exception from heat.common import template_format @@ -22,13 +20,10 @@ from heat.engine import resource from heat.engine import resources from heat.engine.resources.openstack.manila import security_service from heat.engine import scheduler -from heat.engine import stack as stack_parser from heat.engine import template from heat.tests import common from heat.tests import utils -manila_client = importutils.try_import('manilaclient.v1.client') - stack_template = ''' heat_template_version: 2013-05-23 @@ -174,10 +169,3 @@ class ManilaSecurityServiceTest(common.HeatTestCase): scheduler.TaskRunner(ss.update, new_ss)) msg = 'The Resource security_service requires replacement.' self.assertEqual(msg, six.text_type(err)) - - @testtools.skipIf(manila_client is not None, - 'Tests manila client not installed') - def test_no_client(self): - tmpl = template.Template((template_format.parse(stack_template))) - stack = stack_parser.Stack(utils.dummy_context(), 'foo', tmpl) - self.assertRaises(exception.ResourceTypeNotFound, stack.validate) diff --git a/heat/tests/test_manila_share_type.py b/heat/tests/test_manila_share_type.py index c16b6833f4..f0198d26f4 100644 --- a/heat/tests/test_manila_share_type.py +++ b/heat/tests/test_manila_share_type.py @@ -14,8 +14,6 @@ import copy import mock -from oslo_utils import importutils -import testtools from heat.common import exception from heat.common import template_format @@ -23,13 +21,9 @@ from heat.engine import resources from heat.engine.resources.openstack.manila import share_type as mshare_type from heat.engine import rsrc_defn from heat.engine import scheduler -from heat.engine import stack as stack_parser -from heat.engine import template from heat.tests import common from heat.tests import utils -manila_client = importutils.try_import('manilaclient.v1.client') - manila_template = """ heat_template_version: 2013-05-23 resources: @@ -118,10 +112,3 @@ class ManilaShareTypeTest(common.HeatTestCase): fake_share_type.unset_keys.assert_called_once_with({"test": "test"}) fake_share_type.set_keys.assert_called_with( updated_props[mshare_type.ManilaShareType.EXTRA_SPECS]) - - @testtools.skipIf(manila_client is not None, - 'Tests manila client not installed') - def test_no_client(self): - tmpl = template.Template((template_format.parse(manila_template))) - stack = stack_parser.Stack(utils.dummy_context(), 'foo', tmpl) - self.assertRaises(exception.ResourceTypeNotFound, stack.validate) diff --git a/requirements.txt b/requirements.txt index 17b8da1edf..2e413e7ec7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,6 +35,7 @@ python-cinderclient>=1.2.1 python-glanceclient>=0.17.1 python-heatclient>=0.3.0 python-keystoneclient>=1.6.0 +python-manilaclient>=1.0.4 python-neutronclient>=2.3.11,<3 python-novaclient>=2.22.0 python-saharaclient>=0.9.0