summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-05-29 20:52:32 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-05-29 20:52:32 +0000
commiteb92d4866a208c12ab89fdc1d5dc50eaeee3dd32 (patch)
tree05cbdda36aedf5ea948cb87f207634aedb1a0a17 /src/lib
parenta88976e51483e4a9efd45cbbaaefc9e4222d0266 (diff)
downloadbcfg2-eb92d4866a208c12ab89fdc1d5dc50eaeee3dd32.tar.gz
bcfg2-eb92d4866a208c12ab89fdc1d5dc50eaeee3dd32.tar.bz2
bcfg2-eb92d4866a208c12ab89fdc1d5dc50eaeee3dd32.zip
Packages: Fix cases where arch group mappings are unexpected
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5265 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Packages.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 43fd9cf6b..010283fe9 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -181,12 +181,17 @@ class YUMSource(Source):
self.provides[arch][prov].append(pkgname)
def is_package(self, metadata, item):
- arch = [a for a in self.arches if a in metadata.groups][0]
- return item in self.packages['global'] or item in self.packages[arch]
+ arch = [a for a in self.arches if a in metadata.groups]
+ if not arch:
+ return False
+ return item in self.packages['global'] or item in self.packages[arch[0]]
def get_provides(self, metadata, required):
ret = set()
- arch = [a for a in self.arches if a in metadata.groups][0]
+ arches = [a for a in self.arches if a in metadata.groups]
+ if not arches:
+ raise NoData
+ arch = arches[0]
if required in self.provides['global']:
ret.update(Source.get_provides(self, metadata, required))
elif required in self.provides[arch]: