summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-08-19 03:13:28 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-08-19 03:13:28 +0000
commitafe9ec159d4d680fb75950e516b979e8a4338800 (patch)
tree9bb45e9be881a93144fbd27521f4c55088468735 /src/lib/Server
parent481f8a7074160ecf03796700cb6de1d800f417a1 (diff)
downloadbcfg2-afe9ec159d4d680fb75950e516b979e8a4338800.tar.gz
bcfg2-afe9ec159d4d680fb75950e516b979e8a4338800.tar.bz2
bcfg2-afe9ec159d4d680fb75950e516b979e8a4338800.zip
Fix error paths in direct db plugin
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4881 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Plugins/DBStats.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/DBStats.py b/src/lib/Server/Plugins/DBStats.py
index abe8f17f7..f3e4fe652 100644
--- a/src/lib/Server/Plugins/DBStats.py
+++ b/src/lib/Server/Plugins/DBStats.py
@@ -30,8 +30,11 @@ class DBStats(Bcfg2.Server.Plugin.StatisticsPlugin):
def GetCurrentEntry(self, client, e_type, e_name):
c_inst = Client.objects.filter(name=client)[0]
- entry = c_inst.current_interaction.bad_items.filter(kind=e_type,
- name=e_name)[0]
+ result = c_inst.current_interaction.bad_items.filter(kind=e_type,
+ name=e_name)
+ if not result:
+ raise Bcfg2.Server.Plugin.PluginExecutionError
+ entry = result[0]
ret = []
data = ('owner', 'group', 'perms')
for t in data: