summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2010-07-15 20:48:09 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-07-16 16:36:15 -0500
commit646a8f42b21477788a759942f14a8d1997df1709 (patch)
treeb587afaccad1fc4a80d4f62db574a34b5ecc459e /src/lib/Server/Plugins
parentc4f6826b85be5873793741a9fe32f0ce09406f1d (diff)
downloadbcfg2-646a8f42b21477788a759942f14a8d1997df1709.tar.gz
bcfg2-646a8f42b21477788a759942f14a8d1997df1709.tar.bz2
bcfg2-646a8f42b21477788a759942f14a8d1997df1709.zip
DBStats: Handle and warn when an unknown client is given
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5977 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r--src/lib/Server/Plugins/DBStats.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/DBStats.py b/src/lib/Server/Plugins/DBStats.py
index d6d6d7819..fe357fc40 100644
--- a/src/lib/Server/Plugins/DBStats.py
+++ b/src/lib/Server/Plugins/DBStats.py
@@ -69,7 +69,11 @@ class DBStats(Bcfg2.Server.Plugin.Plugin,
c_inst.current_interaction.extra()]
def GetCurrentEntry(self, client, e_type, e_name):
- c_inst = Client.objects.filter(name=client)[0]
+ try:
+ c_inst = Client.objects.filter(name=client)[0]
+ except IndexError:
+ self.logger.error("Unknown client: %s" % client)
+ raise Bcfg2.Server.Plugin.PluginExecutionError
result = c_inst.current_interaction.bad().filter(entry__kind=e_type,
entry__name=e_name)
if not result: