diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-12-15 02:17:35 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-12-15 02:17:35 +0000 |
commit | dd8bcf06f0031584c9d38986422c796fedb7bd7c (patch) | |
tree | edd75c90aecbd23704465002b4cfc77ee78b237e /src/lib | |
parent | e7dd219742af170629d942712b5c5eaee077f1d4 (diff) | |
download | bcfg2-dd8bcf06f0031584c9d38986422c796fedb7bd7c.tar.gz bcfg2-dd8bcf06f0031584c9d38986422c796fedb7bd7c.tar.bz2 bcfg2-dd8bcf06f0031584c9d38986422c796fedb7bd7c.zip |
fix client-specific pkglists
switch to GeneratorError
(Logical change 1.160)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@708 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Generators/Pkgmgr.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Server/Generators/Pkgmgr.py b/src/lib/Server/Generators/Pkgmgr.py index eee1528c1..1ad57e7a4 100644 --- a/src/lib/Server/Generators/Pkgmgr.py +++ b/src/lib/Server/Generators/Pkgmgr.py @@ -3,7 +3,7 @@ __revision__ = '$Revision$' from re import compile as regcompile -from Bcfg2.Server.Generator import Generator, DirectoryBacked, XMLFileBacked +from Bcfg2.Server.Generator import Generator, GeneratorError, DirectoryBacked, XMLFileBacked class PackageEntry(XMLFileBacked): '''PackageEntry is a set of packages and locations for a single image''' @@ -46,13 +46,13 @@ class Pkgmgr(Generator): def FindHandler(self, entry): '''Non static mechanism of determining entry provisioning''' if entry.tag != 'Package': - raise KeyError, (entry.tag, entry.get('name')) + raise GeneratorError, (entry.tag, entry.get('name')) return self.LocatePackage def LocatePackage(self, entry, metadata): '''Locates a package entry for particular metadata''' pkgname = entry.get('name') - if self.pkgdir.has_key("%s.xml" % metadata.hostname): + if self.pkgdir.entries.has_key("%s.xml" % metadata.hostname): pkglist = self.pkgdir["%s.xml" % metadata.hostname] if pkglist.packages.has_key(pkgname): entry.attrib.update(pkglist.packages[pkgname]) @@ -65,4 +65,4 @@ class Pkgmgr(Generator): else: entry.attrib.update(pkg) else: - raise KeyError, ("Package", pkgname) + raise GeneratorError, ("Package", pkgname) |