tests: Only use repo files

In some cases a directory ending in repo could be included in the list,
causing the test to fail.

Resolves: rhbz#2023457
This commit is contained in:
Brian C. Lane 2021-11-15 10:54:30 -08:00
parent 7ec1171035
commit 1201b8b669

View File

@ -151,7 +151,7 @@ if [ ! -e /usr/share/lorax/templates.d/80-rhel/ ]; then
fi
# Gather up the list of system repo files and use them for lorax
REPOS=$(for f in /etc/yum.repos.d/*repo; do echo -n "--repo $f "; done)
REPOS=$(find /etc/yum.repos.d/ -maxdepth 1 -type f -name '*\.repo' -exec echo -n "--repo {} " \;)
if [ -z "$REPOS" ]; then
echo "No system repos found"
exit 1