cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

Parsec: accidentally specifying sections as settings not handled properly

Open MetRonnie opened this issue 3 years ago • 0 comments

Describe the bug

If you specify [scheduler]main loop = something instead of [scheduler][main loop], the workflow validates with no warnings or errors.

[scheduler]
    main loop = 22  # Eh??
    allow implicit tasks = True
[scheduling]
    [[graph]]
        R1 = coffee
$ cylc validate .
Valid for cylc-8.0rc4.dev

Or for the [meta] section, you get traceback:

meta = 22  # Eh??
[scheduler]
    allow implicit tasks = True
[scheduling]
    [[graph]]
        R1 = coffee
$ cylc validate .
Traceback (most recent call last):
  File "~/.conda/envs/cylc8/bin/cylc", line 33, in <module>
    sys.exit(load_entry_point('cylc-flow', 'console_scripts', 'cylc')())
  File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 675, in main
    execute_cmd(command, *cmd_args)
  File "~/github/cylc-flow/cylc/flow/scripts/cylc.py", line 283, in execute_cmd
    entry_point.resolve()(*args)
  File "~/github/cylc-flow/cylc/flow/terminal.py", line 226, in wrapper
    wrapped_function(*wrapped_args, **wrapped_kwargs)
  File "~/github/cylc-flow/cylc/flow/scripts/validate.py", line 116, in main
    cfg = WorkflowConfig(
  File "~/github/cylc-flow/cylc/flow/config.py", line 477, in __init__
    self._check_task_event_handlers()
  File "~/github/cylc-flow/cylc/flow/config.py", line 1488, in _check_task_event_handlers
    get_event_handler_data(taskdef.rtconfig, self.cfg)
  File "~/github/cylc-flow/cylc/flow/task_events_mgr.py", line 317, in get_event_handler_data
    for key, value in workflow_cfg['meta'].items():
AttributeError: 'str' object has no attribute 'items'

Expected behaviour

An IllegalItemError should be raised.

Pull requests welcome! This is an Open Source project - please consider contributing a bug fix yourself (please read CONTRIBUTING.md before starting any work though).

MetRonnie avatar Jul 01 '22 17:07 MetRonnie