[PATCH] Change how we find an install class in a file (#587696).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Install class files in RHEL6 no longer export something named "InstallClass"
since we're using object inheritance.  That means we have to have a smarter
search method - just look for something that's a BaseInstallClass subclass.
Note that we can't use types.ObjectType here because BaseInstallClass inherits
from object, which is a types.TypeType.

Further note that even with this fix, RHEL will continue to use the Fedora
install class until such time as we start shipping an install class in the
product.img files.  Currently, anaconda has no valid displayable RHEL install
classes - only the base one.
---
 installclass.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/installclass.py b/installclass.py
index 6756405..09335c8 100644
--- a/installclass.py
+++ b/installclass.py
@@ -280,7 +280,14 @@ def availableClasses(showHidden=0):
         try:
             loaded = imputil.imp.load_module(mainName, found[0], found[1], found[2])
 
-            obj = loaded.InstallClass
+            # Get the first class out of the installclasses/*.py file we just
+            # loaded that doesn't also happen to be BaseInstallClass.
+            for (k, obj) in loaded.__dict__.iteritems():
+                if k != "BaseInstallClass" and k.endswith("InstallClass"):
+                    break
+
+            if not obj:
+                raise Exception
 
 	    if obj.__dict__.has_key('sortPriority'):
 		sortOrder = obj.sortPriority
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux