-
|
🌊 Heya! I noticed that
If this is a happy accident, I would be curious to know: are there are any current plans to change how things work in this regard? ✨ Thank you kindly! -- A few examples to illustrate what I mean: Given Target a group with no hosts Target a group that is populated and a group with no hosts Target all groups -- including groups with no hosts |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
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:
So yes, you can safely continue using empty groups in your inventory. It's now part of the tested behavior. |
Beta Was this translation helpful? Give feedback.
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: