From a6f9518648887a5c14c2dac477da0647fe9da06d Mon Sep 17 00:00:00 2001 From: Alan Mason <1923621+2Shirt@users.noreply.github.com> Date: Fri, 1 Dec 2017 12:41:39 -0800 Subject: [PATCH] Bugfix: find_windows_image() --- Scripts/functions/windows_setup.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Scripts/functions/windows_setup.py b/Scripts/functions/windows_setup.py index 90ff549f..1d960367 100644 --- a/Scripts/functions/windows_setup.py +++ b/Scripts/functions/windows_setup.py @@ -56,17 +56,20 @@ def find_windows_image(windows_version): # Check for network source if not image: mount_windows_share() - if not WINDOWS_SERVER['Mounted']: - return None - for ext in ['esd', 'wim', 'swm']: - path = r'\\{}\{}\images\{}.ext'.format( - WINDOWS_SERVER['IP'], WINDOWS_SERVER['Share'], imagefile, ext) - if os.path.isfile(path) and wim_contains_image(path, imagename): - image['Path'] = path - image['Source'] = None - if ext == 'swm': - image['Glob'] = '--ref="{}*.swm"'.format(image['Path'][:-4]) - break + if WINDOWS_SERVER['Mounted']: + for ext in ['esd', 'wim', 'swm']: + path = r'\\{}\{}\images\{}.ext'.format( + WINDOWS_SERVER['IP'], + WINDOWS_SERVER['Share'], + imagefile, + ext) + if os.path.isfile(path) and wim_contains_image(path, imagename): + image['Path'] = path + image['Source'] = None + if ext == 'swm': + image['Glob'] = '--ref="{}*.swm"'.format( + image['Path'][:-4]) + break # Display image to be used (if any) and return if image: