From afe9ec159d4d680fb75950e516b979e8a4338800 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 19 Aug 2008 03:13:28 +0000 Subject: 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 --- src/lib/Server/Plugins/DBStats.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') 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: -- cgit v1.2.3-1-g7c22