diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-11-02 15:19:24 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-11-02 15:19:24 +0000 |
commit | f2ba3ae4e2d4d4a51f6a854461e6fe8e0a86e1a5 (patch) | |
tree | 8f9e91fb20f1a9d0e209393efdee3b78d1a6b28c | |
parent | 85355c566953356bd6e75b0285369249f0d19cc4 (diff) | |
download | bcfg2-f2ba3ae4e2d4d4a51f6a854461e6fe8e0a86e1a5.tar.gz bcfg2-f2ba3ae4e2d4d4a51f6a854461e6fe8e0a86e1a5.tar.bz2 bcfg2-f2ba3ae4e2d4d4a51f6a854461e6fe8e0a86e1a5.zip |
add error handling clause
(Logical change 1.138)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@625 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Generator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Server/Generator.py b/src/lib/Server/Generator.py index c9befcb01..14acabbe0 100644 --- a/src/lib/Server/Generator.py +++ b/src/lib/Server/Generator.py @@ -207,5 +207,8 @@ class ScopedXMLFile(SingleXMLFileBacked): def FetchRecord(self, entry, metadata): l = self.store[entry.tag][entry.attrib['name']] useful = [x for x in l if self.MatchMetadata(x[0], metadata)] - data = useful[-1][-1] - entry.attrib.update(data.attrib) + if not useful: + syslog(LOG_ERR, "Failed to FetchRecord %s:%s"%(entry.tag, entry.get('name'))) + else: + data = useful[-1][-1] + entry.attrib.update(data.attrib) |