Commit bee4ce5
committed
Fix logic error in binary detection
The `get_base_bin()` function in `default_common.py` iterates through
all of the entries in base.yml and for each entry checks the existence
of each 'path' value in order to locate a valid binary. When the first
binary path is located, Tern should break out of both loops and return
the found binary value. However, due to a logic oversight Tern was only
breaking out of the first loop which meant the function continued to
look for valid binary paths, even after one was found.
For most base OSes this is not an issue because additional binary paths
will not exist. For certain base OSes like photon, however, this was
problematic because both `tdnf` and `rpm` binary paths exist even though
only the `tdnf` binary actually works for package metadata collection.
This commit adds code to break out of the second loop once a valid
binary is found.
Resolves #1156
Signed-off-by: Rose Judge <rjudge@vmware.com>1 parent dd8a062 commit bee4ce5
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
0 commit comments