From 7434d1c6bf0518903600847976ca0f017d3026be Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Tue, 28 Aug 2012 11:00:41 -0400 Subject: We don't need image_file in the live payload. / is always mounted for us anyway, and since we're using rsync it's just a simple matter of copying from that directory to our destination. --- pyanaconda/packaging/__init__.py | 5 ++--- pyanaconda/packaging/livepayload.py | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'pyanaconda/packaging') diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py index d693bbc12..dcfc0274a 100644 --- a/pyanaconda/packaging/__init__.py +++ b/pyanaconda/packaging/__init__.py @@ -620,11 +620,10 @@ class ImagePayload(Payload): """ An ImagePayload installs an OS image to the target system. """ def __init__(self, data): super(ImagePayload, self).__init__(data) - self.image_file = None def setup(self, storage): - if not self.image_file: - exn = PayloadSetupError("image file not set") + if not os.path.ismount("/run/initramfs/live"): + exn = PayloadSetupError("live image is not mounted") if errorHandler.cb(exn) == ERROR_RAISE: raise exn diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py index 6a27a4fd0..d6c1c3179 100644 --- a/pyanaconda/packaging/livepayload.py +++ b/pyanaconda/packaging/livepayload.py @@ -47,11 +47,6 @@ from pyanaconda.errors import * class LiveImagePayload(ImagePayload): """ A LivePayload copies the source image onto the target system. """ - def setup(self, storage): - super(LiveImagePayload, self).setup(storage) - if not stat.S_ISBLK(os.stat(self.image_file)[stat.ST_MODE]): - raise PayloadSetupError("unable to find image") - def install(self): """ Install the payload. """ cmd = "rsync" -- cgit