Skip to content

Commit

Permalink
Cycle point format colon restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland authored and hjoliver committed Aug 31, 2021
1 parent 71ee727 commit 19bdbf5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
14 changes: 13 additions & 1 deletion cylc/flow/parsec/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,19 @@ def coerce_cycle_point_format(cls, value, keys):
hour_of_day=4, minute_of_hour=30,
second_of_minute=54)
if '/' in value:
raise IllegalValueError('cycle point format', keys, value)
raise IllegalValueError(
'cycle point format', keys, value, msg=(
'Illegal character: "/".'
' Datetimes are used in Cylc file paths.'
)
)
if ':' in value:
raise IllegalValueError(
'cycle point format', keys, value, msg=(
'Illegal character: ":".'
' Datetimes are used in Cylc file paths.'
)
)
if '%' in value:
try:
TimePointDumper().strftime(test_timepoint, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ workflow_run_ok "${TEST_NAME_BASE}-run" \
# Only t1 should have job.err and job.out retrieved.

sed "/'job-logs-retrieve'/!d" \
"${WORKFLOW_RUN_DIR}/log/job/2020-02-02T02:02Z/t"{1,2}'/'{01,02,03}'/job-activity.log' \
"${WORKFLOW_RUN_DIR}/log/job/20200202T0202Z/t"{1,2}'/'{01,02,03}'/job-activity.log' \
>'edited-activities.log'
cmp_ok 'edited-activities.log' <<__LOG__
[(('job-logs-retrieve', 'retry'), 1) ret_code] 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

[scheduler]
UTC mode = True
cycle point format = %Y-%m-%dT%H:%MZ
cycle point format = %Y%m%dT%H%MZ

[scheduling]
initial cycle point = 2020-02-02T02:02Z
final cycle point = 2020-02-02T02:02Z
initial cycle point = 20200202T0202Z
final cycle point = 20200202T0202Z
[[graph]]
R1 = T

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
2015-06-19T14:47:30+01 INFO - Initial point: 2020-02-02T02:02Z
2015-06-19T14:47:30+01 INFO - Final point: 2020-02-02T02:02Z
2015-06-19T14:47:30+01 INFO - [t1.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t1.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t1.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.2020-02-02T02:02Z] -triggered off []
2015-06-19T14:47:30+01 INFO - Initial point: 20200202T0202Z
2015-06-19T14:47:30+01 INFO - Final point: 20200202T0202Z
2015-06-19T14:47:30+01 INFO - [t1.20200202T0202Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t1.20200202T0202Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t1.20200202T0202Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.20200202T0202Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.20200202T0202Z] -triggered off []
2015-06-19T14:47:30+01 INFO - [t2.20200202T0202Z] -triggered off []

0 comments on commit 19bdbf5

Please sign in to comment.