Skip to content
Snippets Groups Projects
Commit 8c4d8ca2 authored by Sam Thursfield's avatar Sam Thursfield Committed by Tristan Van Berkom
Browse files

Catch attempts to compose a list

Attempting to compose a list property would result in an unhandled
exception:

    AttributeError: 'CommentedSeq' object has no attribute 'get'

We now at least detect the situation and produce an exception that
the frontend will report neatly:

    Error loading pipeline: element.bst [line 11 column 4]: Only values of type 'dict' can be composed.

I was getting this error from an attempt to conditionally extend the
sources list:

    sources:
      (?):
        arch == "x86_64":
          - url: http://example.com/x86_64

The correct way to do this is to move the conditional into the parent
dict, e.g.:

    (?):
      arch == "x86_64":
        sources:
          - url: https://example.com/x86_64

It would be nice if the error message could hint at how the user can do
what they want, but it doesn't seem possible in this case.
parent 459cc8a2
No related branches found
No related tags found
Loading
Pipeline #
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment