[master 1/1] fix storage writing for live and ostree installs (#1236937)

AdamWill installerbot-noreply at redhat.com
Thu Jul 16 18:55:28 UTC 2015


From: Adam Williamson <awilliam at redhat.com>

3e800998 broke storage writing in two cases: regular live
installs and ostree installs. The old write_storage_late check
checked for flags.livecdInstall and ksdata.ostreesetup.seen as
well as ksdata.method.method == "liveimg". The new check in
writeStorageLate() dropped those two, only keeping the method
check.

Since the idea here is that payloads choose which writeStorage
method to use and override the other with a pass, let's change
the conditionals in the writeStorage methods to only check for
dirinstall, and tweak the payloads to match the behaviour we
want: LiveImagePayload, LiveImageKSPayload and RPMOSTreePayload
choose writeStorageLate(), DNFPayload chooses
writeStorageEarly(). Note - LiveImageKSPayload inherits from
LiveImagePayload. I left TarPayload alone since it's incomplete,
but I guess it'd want Late.
---
 pyanaconda/packaging/__init__.py    | 4 ++--
 pyanaconda/packaging/dnfpayload.py  | 3 +++
 pyanaconda/packaging/livepayload.py | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
index ada75ff..870d289 100644
--- a/pyanaconda/packaging/__init__.py
+++ b/pyanaconda/packaging/__init__.py
@@ -605,7 +605,7 @@ def writeStorageEarly(self):
            just the dnfpayload.  Payloads should only implement one of these
            methods by overriding the unneeded one with a pass.
         """
-        if self.data.method.method != "liveimg" and not flags.dirInstall:
+        if not flags.dirInstall:
             self.storage.write()
 
     def writeStorageLate(self):
@@ -614,7 +614,7 @@ def writeStorageLate(self):
            every payload except for dnf.  Payloads should only implement one of
            these methods by overriding the unneeded one with a pass.
         """
-        if self.data.method.method == "liveimg" and not flags.dirInstall:
+        if not flags.dirInstall:
             if iutil.getSysroot() != iutil.getTargetPhysicalRoot():
                 setSysroot(iutil.getTargetPhysicalRoot(), iutil.getSysroot())
 
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 818eac4..311c7f8 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -848,3 +848,6 @@ def postInstall(self):
                 log.error(e)
 
         super(DNFPayload, self).postInstall()
+
+    def writeStorageLate(self):
+        pass
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index c0508a5..5056fed 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -201,6 +201,9 @@ def _updateKernelVersionList(self):
     def kernelVersionList(self):
         return self._kernelVersionList
 
+    def writeStorageEarly(self):
+        pass
+
 class DownloadProgress(object):
     """ Provide methods for download progress reporting."""
 
@@ -539,6 +542,3 @@ def kernelVersionList(self):
             # Strip out vmlinuz- from the names
             return sorted((n.split("/")[-1][8:] for n in names if "boot/vmlinuz-" in n),
                     key=functools.cmp_to_key(versionCmp))
-
-    def writeStorageEarly(self):
-        pass


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/b5ede2f1baf7167b834e1222b993471bb10c4a2b


More information about the anaconda-patches mailing list