FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-30-2010, 08:12 PM
David Cantrell
 
Default Add all possible install class locations to the search path (#587696).

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ack.

On Fri, 30 Apr 2010, Chris Lumens wrote:


RHEL6 install classes inherit from each other. In order for anaconda to import
a subclass, it's going to have to have the location of the subclass in the path
too.

Also, fix the base RHEL install class's name so we don't get an import error.
---
installclass.py | 21 +++++++++++----------
installclasses/rhel.py | 2 +-
2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/installclass.py b/installclass.py
index 6756405..deb7e53 100644
--- a/installclass.py
+++ b/installclass.py
@@ -245,20 +245,21 @@ def availableClasses(showHidden=0):
else:
if allClasses_hidden: return allClasses_hidden

- if os.access("installclasses", os.R_OK):
- path = "installclasses"
- elif os.access("/tmp/updates/installclasses", os.R_OK):
- path = "/tmp/updates/installclasses"
- elif os.access("/tmp/product/installclasses", os.R_OK):
- path = "/tmp/product/installclasses"
- else:
- path = "/usr/lib/anaconda/installclasses"
+ path = []
+
+ for dir in ["installclasses", "/tmp/updates/installclasses",
+ "/tmp/product/installclasses", "/usr/lib/anaconda/installclasses"]:
+ if os.access(dir, os.R_OK):
+ path.append(dir)

# append the location of installclasses to the python path so we
# can import them
- sys.path.insert(0, path)
+ sys.path = path + sys.path
+
+ files = []
+ for p in reversed(path):
+ files += os.listdir(p)

- files = os.listdir(path)
done = {}
list = []
for file in files:
diff --git a/installclasses/rhel.py b/installclasses/rhel.py
index 7aaf356..46dfca8 100644
--- a/installclasses/rhel.py
+++ b/installclasses/rhel.py
@@ -27,7 +27,7 @@ import types
import installmethod
import yuminstall

-class RHELInstallClass(BaseInstallClass):
+class InstallClass(BaseInstallClass):
# name has underscore used for mnemonics, strip if you dont need it
id = "rhel"
name = N_("Red Hat Enterprise Linux")



- --
David Cantrell <dcantrell@redhat.com>

Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvbOasACgkQ5hsjjIy1VklX5QCfVd0H/RLRqQ8hyUQMU6aXV3v4
0+8An2ei9O+isdOJ1W1RRBn6zPXPsKQy
=YDeU
-----END PGP SIGNATURE-----

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

Thread Tools




All times are GMT. The time now is 06:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org