summaryrefslogtreecommitdiffstats
path: root/backend.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-12-18 16:37:51 -0500
committerChris Lumens <clumens@redhat.com>2010-02-04 14:07:30 -0500
commit479defc726e4c1ae665258e7fc80e4ff159698ee (patch)
tree5a4b196b150c73e5c2dcf3965e63676713de4b86 /backend.py
parent39a52ed1ddb2c4db05045955ccf9ba6066637807 (diff)
downloadanaconda-479defc726e4c1ae665258e7fc80e4ff159698ee.tar.gz
anaconda-479defc726e4c1ae665258e7fc80e4ff159698ee.tar.xz
anaconda-479defc726e4c1ae665258e7fc80e4ff159698ee.zip
Move upgrade-related data to the Anaconda object.
This also removes the hack where upgrade can be True, False, or None in order to test whether we've seen the upgrade screen or not. Instead, it introduces a global value hack. I consider this the slightly cleaner approach.
Diffstat (limited to 'backend.py')
-rw-r--r--backend.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/backend.py b/backend.py
index 139fecaa0..6303bda95 100644
--- a/backend.py
+++ b/backend.py
@@ -43,7 +43,7 @@ class AnacondaBackend:
def __init__(self, anaconda):
"""Abstract backend class all backends should inherit from this
@param instPath: root path for the installation to occur"""
-
+ self.anaconda = anaconda
self.instPath = anaconda.rootPath
self.instLog = None
self.modeText = ""
@@ -69,7 +69,7 @@ class AnacondaBackend:
pass
def doPreInstall(self, anaconda):
- self.initLog(anaconda.id, anaconda.rootPath)
+ self.initLog(anaconda.rootPath)
def copyFirmware(self, anaconda):
# Multiple driver disks may be loaded, so we need to glob for all
@@ -120,13 +120,11 @@ class AnacondaBackend:
log.warning("doInstall not implemented for backend!")
raise NotImplementedError
- def initLog(self, id, instPath):
- upgrade = id.getUpgrade()
-
+ def initLog(self, instPath):
if not os.path.isdir(instPath + "/root"):
iutil.mkdirChain(instPath + "/root")
- if upgrade:
+ if self.anaconda.upgrade:
logname = '/root/upgrade.log'
else:
logname = '/root/install.log'
@@ -146,7 +144,7 @@ class AnacondaBackend:
pass
backend_log.log.start(instPath, syslogname)
- if upgrade:
+ if self.anaconda.upgrade:
self.modeText = _("Upgrading %s\n")
else:
self.modeText = _("Installing %s\n")
@@ -285,7 +283,7 @@ def doBackendSetup(anaconda):
if anaconda.backend.doBackendSetup(anaconda) == DISPATCH_BACK:
return DISPATCH_BACK
- if anaconda.id.upgrade:
+ if anaconda.upgrade:
anaconda.backend.checkSupportedUpgrade(anaconda)
iutil.writeRpmPlatform(anaconda.rootPath)