mirror of https://git.48k.eu/ogclient
live: use .ant image as main image after image creation error
Restore image file from .ant to original file name if new image creation fails. Remove new imagen and move the .ant image file in place of the original as previously an error meant a rename of the image file without a revert to keep the image available.master
parent
c3ce5342c9
commit
25b00bfd69
|
@ -504,6 +504,12 @@ class OgLiveOperations:
|
|||
|
||||
image_info = ogGetImageInfo(image_path)
|
||||
except Exception as e:
|
||||
if os.path.exists(image_path):
|
||||
os.unlink(image_path)
|
||||
|
||||
if os.path.exists(f'{image_path}.ant'):
|
||||
shutil.move(f'{image_path}.ant', image_path)
|
||||
|
||||
self._restartBrowser(self._url)
|
||||
raise RuntimeError(f'Failed to create image for {fstype} filesystem in device {padev}: {e}') from e
|
||||
|
||||
|
|
Loading…
Reference in New Issue