Skip to content
Discussion options

You must be logged in to vote

I looked into this, and the graceful handling of empty groups is natural behavior that emerges from how the code works.

When spot encounters an empty group, it returns an empty list of hosts which gets merged with other results. No special handling, no errors - unless ALL groups are empty, in which case you'll get a "no hosts found" error (which makes sense).

Since this behavior is useful (as you've noticed), I added tests in PR #303 to make sure we don't accidentally break it in the future. The tests cover:

  • Targeting only empty groups → error as expected
  • Mix of empty and populated groups → works fine, only populated groups contribute hosts
  • The "all" target with empty groups present → wo…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by bbbbbrie
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