Commit dbccf26
committed
lambdalabs: Validate tier selection script output format
The tier selection script outputs "instance_type region" which is then
parsed by splitting on whitespace and accessing indices [0] and [1].
If the script produces unexpected output such as an empty line or a
single word, the split operation produces a list with fewer than two
elements, causing Ansible to fail with a cryptic index error.
Add an explicit validation task using ansible.builtin.assert to verify
the output contains exactly two whitespace-separated values before
attempting to parse it. This provides a clear error message showing the
actual output when the format is invalid, making debugging easier.
Generated-by: Claude AI
Signed-off-by: Chuck Lever <cel@kernel.org>1 parent eebb25d commit dbccf26
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
141 | 156 | | |
142 | 157 | | |
143 | 158 | | |
| |||
0 commit comments