diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-11-13 17:25:46 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-11-13 17:25:46 +0000 |
commit | 4d9df01b47cf0110d0815eaddecdbfdc3e42f120 (patch) | |
tree | 07b5eb8f3d44b939429e92cb16bf20bf0eb900e2 /src | |
parent | 2d772485a34d9076ed60e0e591346cd2d01fb46f (diff) | |
download | bcfg2-4d9df01b47cf0110d0815eaddecdbfdc3e42f120.tar.gz bcfg2-4d9df01b47cf0110d0815eaddecdbfdc3e42f120.tar.bz2 bcfg2-4d9df01b47cf0110d0815eaddecdbfdc3e42f120.zip |
Improve Statistics plugin error handling when no entry pull data is available (Reported by Fernando Laudares Camargos)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4974 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Server/Plugins/Statistics.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Statistics.py b/src/lib/Server/Plugins/Statistics.py index 2ba7d5648..7c5394a51 100644 --- a/src/lib/Server/Plugins/Statistics.py +++ b/src/lib/Server/Plugins/Statistics.py @@ -129,6 +129,8 @@ class Statistics(Bcfg2.Server.Plugin.StatisticsPlugin): def GetCurrentEntry(self, client, e_type, e_name): curr = self.FindCurrent(client) entry = curr.xpath('.//Bad/%s[@name="%s"]' % (e_type, e_name)) + if not entry: + raise Bcfg2.Server.Plugin.PluginExecutionError cfentry = entry[-1] owner = cfentry.get('current_owner', cfentry.get('owner')) |