[PATCH] do not delete liveimg --url=file:/// file
Vratislav Podzimek
vpodzime at redhat.com
Tue Nov 18 08:04:29 UTC 2014
On Sun, 2014-11-16 at 13:58 -0500, Gene Czarcinski wrote:
> If liveimg --url=file:// do not delete the referenced file. Only
> delete those files which are downloaded. (RHBZ 1164585)
> ---
> pyanaconda/packaging/livepayload.py | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
> index fbdb38f..6b235ea 100644
> --- a/pyanaconda/packaging/livepayload.py
> +++ b/pyanaconda/packaging/livepayload.py
> @@ -431,13 +431,20 @@ class LiveImageKSPayload(LiveImagePayload):
>
> def postInstall(self):
> """ Unmount image, remove image file from target
> + unless filr:// specified in which case just
typo^^^
> + umount it.
> """
> super(LiveImageKSPayload, self).postInstall()
>
> if os.path.exists(IMAGE_DIR+"/LiveOS"):
> blivet.util.umount(IMAGE_DIR)
>
> - if os.path.exists(self.image_path):
> + if self.data.method.url.startswith("file://"):
> + log.debug("live-postInstall: file://specified, just umount")
> + blivet.util.umount(self.image_path)
> +
> + elif os.path.exists(self.image_path):
> + log.debug("live-postInstall: delete downloaded file")
> os.unlink(self.image_path)
No umount in the elif branch.
--
Vratislav Podzimek
Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list