From c7e33f10eff7434b9bd581f1247abafc2778d415 Mon Sep 17 00:00:00 2001 From: pengdake <19921207pq@gmail.com> Date: Mon, 7 May 2018 14:29:38 +0800 Subject: [PATCH] Add namespace in exception info We need namespace to confirm the workflow. Change-Id: I26cefe541df32ea3a82c3e38df0ab5709b022eb5 Signed-off-by: pengdake <19921207pq@gmail.com> --- mistral/db/v2/sqlalchemy/api.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mistral/db/v2/sqlalchemy/api.py b/mistral/db/v2/sqlalchemy/api.py index 5e238bf91..984891093 100644 --- a/mistral/db/v2/sqlalchemy/api.py +++ b/mistral/db/v2/sqlalchemy/api.py @@ -514,8 +514,8 @@ def update_workflow_definition(identifier, values, namespace='', session=None): if c_t.project_id != wf_def.project_id: raise exc.NotAllowedException( "Can not update scope of workflow that has cron triggers " - "associated in other tenants. [workflow_identifier=%s]" % - identifier + "associated in other tenants. [workflow_identifier=%s, " + "namespace=%s]" % (identifier, namespace) ) # Check event triggers. @@ -527,8 +527,8 @@ def update_workflow_definition(identifier, values, namespace='', session=None): if e_t.project_id != wf_def.project_id: raise exc.NotAllowedException( "Can not update scope of workflow that has event triggers " - "associated in other tenants. [workflow_identifier=%s]" % - identifier + "associated in other tenants. [workflow_identifier=%s, " + "namespace=%s]" % (identifier, namespace) ) wf_def.update(values.copy()) @@ -554,8 +554,12 @@ def delete_workflow_definition(identifier, namespace='', session=None): if cron_triggers: raise exc.DBError( "Can't delete workflow that has cron triggers associated. " - "[workflow_identifier=%s], [cron_trigger_id(s)=%s]" % - (identifier, ', '.join([t.id for t in cron_triggers])) + "[workflow_identifier=%s, namespace=%s], [cron_trigger_id(s)=%s]" + % ( + identifier, + namespace, + ', '.join([t.id for t in cron_triggers]) + ) ) event_triggers = get_event_triggers(insecure=True, workflow_id=wf_def.id)