Move the 'unknown' image check below the renaming gubbins

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2021-09-10 11:07:58 -07:00
parent 6fbe122c0c
commit 841fdf1ffb

View File

@ -605,11 +605,6 @@ def check(hdds, nextrel=None):
unknown = [] unknown = []
# Get the list of all 'expected' images # Get the list of all 'expected' images
expected = get_all_images(hdds, nextrel=nextrel) expected = get_all_images(hdds, nextrel=nextrel)
# Get the list of all present image files
files = set(fl for fl in os.listdir('.') if fl.startswith('disk') and fl.endswith('img'))
# Compare present images vs. expected images to produce 'unknown'
expnames = set(img.filename for img in expected)
unknown = list(files.difference(expnames))
# Now determine if images are absent or outdated # Now determine if images are absent or outdated
for img in expected: for img in expected:
@ -628,6 +623,12 @@ def check(hdds, nextrel=None):
continue continue
current.append(img) current.append(img)
# Get the list of all present image files
files = set(fl for fl in os.listdir('.') if fl.startswith('disk') and (fl.endswith('img') or fl.endswith('qcow2')))
# Compare present images vs. expected images to produce 'unknown'
expnames = set(img.filename for img in expected)
unknown = list(files.difference(expnames))
logger.debug("Current images: %s", ', '.join([img.filename for img in current])) logger.debug("Current images: %s", ', '.join([img.filename for img in current]))
logger.debug("Missing images: %s", ', '.join([img.filename for img in missing])) logger.debug("Missing images: %s", ', '.join([img.filename for img in missing]))
logger.debug("Outdated images: %s", ', '.join([img.filename for img in outdated])) logger.debug("Outdated images: %s", ', '.join([img.filename for img in outdated]))