diff --git a/createhdds.py b/createhdds.py index e449693..a4d07fb 100755 --- a/createhdds.py +++ b/createhdds.py @@ -605,11 +605,6 @@ def check(hdds, nextrel=None): unknown = [] # Get the list of all 'expected' images 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 for img in expected: @@ -628,6 +623,12 @@ def check(hdds, nextrel=None): continue 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("Missing images: %s", ', '.join([img.filename for img in missing])) logger.debug("Outdated images: %s", ', '.join([img.filename for img in outdated]))