summaryrefslogtreecommitdiffstats
path: root/installclass.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-08-10 15:15:01 +0000
committerJeremy Katz <katzj@redhat.com>2006-08-10 15:15:01 +0000
commit69dd7c101fbecc7f745aead56398a65169d69cdf (patch)
treef792840973f31461acf1dc5f6509b4210c7ab932 /installclass.py
parentcda2b01dba1bff4e9885ddb7ec9484c8baf88ce9 (diff)
downloadanaconda-69dd7c101fbecc7f745aead56398a65169d69cdf.tar.gz
anaconda-69dd7c101fbecc7f745aead56398a65169d69cdf.tar.xz
anaconda-69dd7c101fbecc7f745aead56398a65169d69cdf.zip
2006-08-10 Jeremy Katz <katzj@redhat.com>
* installclass.py (getBaseInstallClass): Add a method for finding the default base install class so that I don't copy and paste the code between kickstart and upgrade cases * kickstart.py (Kickstart): Use getBaseInstallClass * upgradeclass.py (InstallClass): Use proper base install class (#201745)
Diffstat (limited to 'installclass.py')
-rw-r--r--installclass.py32
1 files changed, 27 insertions, 5 deletions
diff --git a/installclass.py b/installclass.py
index c5d2d25aa..5518ebfa5 100644
--- a/installclass.py
+++ b/installclass.py
@@ -463,11 +463,6 @@ class BaseInstallClass:
def __init__(self, expert):
pass
-# we need to be able to differentiate between this and custom
-class DefaultInstall(BaseInstallClass):
- def __init__(self, expert):
- BaseInstallClass.__init__(self, expert)
-
allClasses = []
allClasses_hidden = []
@@ -549,3 +544,30 @@ def ordering(first, second):
return 1
return 0
+
+def getBaseInstallClass():
+ # figure out what installclass we should base on. this is largely needed
+ # due to nonsense about how things like upgrades and kickstart are
+ # implemented as installclasses :/
+ allavail = availableClasses(showHidden = 1)
+ avail = availableClasses(showHidden = 0)
+ if len(avail) == 1:
+ (cname, cobject, clogo) = avail[0]
+ log.info("using only installclass %s" %(cname,))
+ return cobject
+ elif len(allavail) == 1:
+ (cname, cobject, clogo) = allavail[0]
+ log.info("using only installclass %s" %(cname,))
+ return cobject
+ else:
+ cobject = BaseInstallClass
+ log.info("using baseinstallclass as base")
+ return BaseInstallClass
+
+baseclass = getBaseInstallClass()
+
+# we need to be able to differentiate between this and custom
+class DefaultInstall(baseclass):
+ def __init__(self, expert):
+ BaseInstallClass.__init__(self, expert)
+