diff --git a/functionaltests/run_tests_common.sh b/functionaltests/run_tests_common.sh index 8ffc97a22..2f97be1fd 100755 --- a/functionaltests/run_tests_common.sh +++ b/functionaltests/run_tests_common.sh @@ -5,7 +5,7 @@ # How many seconds to wait for the API to be responding before giving up API_RESPONDING_TIMEOUT=20 -if ! timeout ${API_RESPONDING_TIMEOUT} sh -c "while ! curl -s http://127.0.0.1:8082/v1/ 2>/dev/null | grep -q 'Authentication required' ; do sleep 1; done"; then +if ! timeout ${API_RESPONDING_TIMEOUT} sh -c "while ! curl -s http://127.0.0.1:8082/v1/ 2>/dev/null | grep -q 'Unauthorized' ; do sleep 1; done"; then echo "Murano API failed to respond within ${API_RESPONDING_TIMEOUT} seconds" exit 1 fi diff --git a/murano/engine/system/system_objects.py b/murano/engine/system/system_objects.py index 10343e686..a948dee93 100644 --- a/murano/engine/system/system_objects.py +++ b/murano/engine/system/system_objects.py @@ -18,21 +18,21 @@ from murano.engine.system import agent_listener from murano.engine.system import heat_stack from murano.engine.system import instance_reporter from murano.engine.system import logger -from murano.engine.system import mistralclient from murano.engine.system import net_explorer from murano.engine.system import resource_manager from murano.engine.system import status_reporter from murano.engine.system import test_fixture +from murano.engine.system import workflowclient def register(package): package.register_class(agent.Agent) package.register_class(agent_listener.AgentListener) package.register_class(heat_stack.HeatStack) - package.register_class(mistralclient.MistralClient) package.register_class(resource_manager.ResourceManager) package.register_class(instance_reporter.InstanceReportNotifier) package.register_class(status_reporter.StatusReporter) package.register_class(net_explorer.NetworkExplorer) package.register_class(logger.Logger) package.register_class(test_fixture.TestFixture) + package.register_class(workflowclient.MistralClient) diff --git a/murano/engine/system/mistralclient.py b/murano/engine/system/workflowclient.py similarity index 90% rename from murano/engine/system/mistralclient.py rename to murano/engine/system/workflowclient.py index 2b6cc7a78..168f48e7c 100644 --- a/murano/engine/system/mistralclient.py +++ b/murano/engine/system/workflowclient.py @@ -18,16 +18,19 @@ import json import eventlet try: - import mistralclient.api.client as mistralclient + from mistralclient.api import client as mistralcli except ImportError as mistral_import_error: - mistralclient = None + mistralcli = None from oslo_config import cfg +from oslo_log import log as logging from murano.common import auth_utils +from murano.common.i18n import _LW from murano.dsl import dsl from murano.dsl import session_local_storage CONF = cfg.CONF +LOG = logging.getLogger(__name__) class MistralError(Exception): @@ -47,7 +50,8 @@ class MistralClient(object): @staticmethod @session_local_storage.execution_session_memoize def _create_client(region): - if not mistralclient: + if not mistralcli: + LOG.warning(_LW("Mistral client is not available")) raise mistral_import_error mistral_settings = CONF.mistral @@ -62,7 +66,7 @@ class MistralClient(object): region_name=region) auth_ref = session.auth.get_access(session) - return mistralclient.client( + return mistralcli.client( mistral_url=mistral_url, project_id=auth_ref.project_id, endpoint_type=endpoint_type, @@ -78,7 +82,7 @@ class MistralClient(object): def run(self, name, timeout=600, inputs=None, params=None): execution = self._client.executions.create( - workflow_name=name, workflow_input=inputs, params=params) + workflow_identifier=name, workflow_input=inputs, params=params) # For the fire and forget functionality - when we do not want to wait # for the result of the run. if timeout == 0: diff --git a/murano/tests/functional/common/tempest_utils.py b/murano/tests/functional/common/tempest_utils.py index b74e89001..5b3907088 100644 --- a/murano/tests/functional/common/tempest_utils.py +++ b/murano/tests/functional/common/tempest_utils.py @@ -30,7 +30,7 @@ class TempestDeployTestMixin(common_utils.DeployTestMixin): def keystone_client(): return ksclient.Client(username=CONF.auth.admin_username, password=CONF.auth.admin_password, - tenant_name=CONF.auth.admin_tenant_name, + tenant_name=CONF.auth.admin_project_name, auth_url=CONF.identity.uri) @staticmethod @@ -40,7 +40,7 @@ class TempestDeployTestMixin(common_utils.DeployTestMixin): auth_url=CONF.identity.uri, username=CONF.auth.admin_username, password=CONF.auth.admin_password, - tenant_name=CONF.auth.admin_tenant_name) + tenant_name=CONF.auth.admin_project_name) session = keystoneclient.session.Session(auth=auth) return cclient.Client(session=session, service_type='policy')