Skip to content

How to trigger failure if arglist doesn't exist as a group step #323

Answered by yaythomas
chrisfunston asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @chrisfunston,

This is by design. . . Or at least I remember I had some sort of good reason for not throwing a hard error and stopping the pipeline if a called group name doesn't exist, but to my embarrasment, now I can't remember why! I'll have a bit more of a think to see if I can ferret out the use-case I had in mind.

In the meantime, you can get the effect you want like this:

context_parser: pypyr.parser.list
steps:
  - name: pypyr.steps.py
    in:
      pycode: |
        #  this is the top-level dict for your pipeline
        pipeline = context.current_pipeline.pipeline_definition.pipeline
        
        for group in context['argList']:
          if group not in pipeline:

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@chrisfunston
Comment options

Answer selected by chrisfunston
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants