Allow hyphens in Workflow and ad-hoc action names

In ba67b3aff8 validation of Workflow and
Action names was fixed. This had the unintended side effect of making
the validation much stricter. This change adds hyphens to the allows
characters.

Change-Id: Ib05c4988ea3dbeaf5f29f5f5674a606b3c652f2d
This commit is contained in:
Dougal Matthews 2017-01-20 14:18:45 +00:00
parent 2852d113b1
commit b8d94ee4b8
3 changed files with 11 additions and 1 deletions

View File

@ -16,6 +16,9 @@ actions:
actionversionaction:
base: std.noop
action-action:
base: std.noop
workflows:
workflowversion:
@ -41,3 +44,9 @@ workflows:
tasks:
task1:
workflow: workflowversion
workflow-with-hyphen:
description: Workflow name containing -
tasks:
task1:
action: action-action

View File

@ -412,6 +412,7 @@ class WorkbookSpecValidation(base.WorkbookSpecValidationTestCase):
"versionworkflow",
"workflowversionworkflow",
"version_workflow",
"version-workflow",
)
for valid in valid_names:

View File

@ -18,7 +18,7 @@ from mistral.workbook.v2 import base
from mistral.workbook.v2 import workflows as wf
# We want to match any single word that isn't exactly "version"
NON_VERSION_WORD_REGEX = "^(?!version$)\w+$"
NON_VERSION_WORD_REGEX = "^(?!version$)[\w-]+$"
class WorkbookSpec(base.BaseSpec):