diff options
author | Peter Jones <pjones@redhat.com> | 2007-01-10 22:13:56 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2007-01-10 22:13:56 +0000 |
commit | fe94682082b19383399ba549deb1cd8a0dc86586 (patch) | |
tree | 8c584c17d297e74a62762721bf738b5c88c3a14e | |
parent | 5334458c28dd4acfcde85c4c4905e84e32762513 (diff) | |
download | anaconda-fe94682082b19383399ba549deb1cd8a0dc86586.tar.gz anaconda-fe94682082b19383399ba549deb1cd8a0dc86586.tar.xz anaconda-fe94682082b19383399ba549deb1cd8a0dc86586.zip |
- support lists or strings rather than one or the other in getPackagePaths()
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | installclasses/rhel.py | 20 |
2 files changed, 18 insertions, 7 deletions
@@ -5,6 +5,11 @@ * fsset.py (FileSystemSet.setActive): don't set ksdata.clearpart["done"] + * installclasses/rhel.py (InstallClass.getPackagePaths): handle either + lists or bare strings in repopath values, so we don't have to worry + about keeping anaconda and rhel-instnum in sync so much (#221146, + #221260) + 2007-01-09 Peter Jones <pjones@redhat.com> * partedUtils.py (DiskSet.openDevices): diff --git a/installclasses/rhel.py b/installclasses/rhel.py index b02a3a32d..59159988d 100644 --- a/installclasses/rhel.py +++ b/installclasses/rhel.py @@ -79,14 +79,15 @@ class InstallClass(BaseInstallClass): def getPackagePaths(self, uri): rc = {} for (name, path) in self.repopaths.items(): + if not type(uri) == types.ListType: + uri = [uri,] + if not type(path) == types.ListType: + path = [path,] + lst = [] - if type(uri) == types.ListType: - for i in uri: - for p in path: - lst.append("%s/%s" % (i, p)) - else: + for i in uri: for p in path: - lst.append("%s/%s" % (uri, p)) + lst.append("%s/%s" % (i, p)) rc[name] = lst @@ -141,7 +142,12 @@ class InstallClass(BaseInstallClass): self.repopaths["virt"] = ["VT"] log.info("Adding Virtualization option") - for repo in reduce(lambda x,y: x+y, self.repopaths.values(), []): + def concat(x, y): + if not type(y) == types.ListType: + y = [y,] + return x+y + + for repo in reduce(concat, self.repopaths.values(), []): if not self.taskMap.has_key(repo.lower()): continue |