From f254c3925737aa8bb53d4072681bc6f7ab7893ff Mon Sep 17 00:00:00 2001 From: Istvan Imre Date: Fri, 24 Nov 2017 14:47:25 +0100 Subject: [PATCH] Wrong handling of is_system flag at workbooks causes DB error with MySQL 5.7 If we leave is_system workbook attribute as undefined (Null) that causes database insert error in MySQL 5.7, due to database constraints. So let's use constant False as is_system attribute in workbook create. It is OK, because there is no system workbook support in mistral yet. Change-Id: Idabf9d04d105c2386b9b110f1bbab3e69502b8e0 Closes-Bug: #1733501 --- mistral/services/workbooks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mistral/services/workbooks.py b/mistral/services/workbooks.py index 1e9ab184d..81b068f43 100644 --- a/mistral/services/workbooks.py +++ b/mistral/services/workbooks.py @@ -100,7 +100,8 @@ def _create_or_update_workflows(wb_db, workflows_spec): 'scope': wb_db.scope, 'project_id': wb_db.project_id, 'namespace': '', - 'tags': wf_spec.get_tags() + 'tags': wf_spec.get_tags(), + 'is_system': False } db_wfs.append( @@ -116,7 +117,8 @@ def _get_workbook_values(wb_spec, definition, scope): 'tags': wb_spec.get_tags(), 'definition': definition, 'spec': wb_spec.to_dict(), - 'scope': scope + 'scope': scope, + 'is_system': False } return values