Permalink
Browse files

Don't show password in events.

Fixes ZEN-4365 for oVirt.
  • Loading branch information...
cluther committed Nov 29, 2012
1 parent 6ed1a8d commit d1ee2f549c7cf01c8c9e98075d87249fd27e80f8
@@ -78,7 +78,7 @@ def processResults(self, cmd, result):
result.events.append({
'severity': cmd.severity,
'summary': 'error parsing command output',
- 'eventKey': cmd.command,
+ 'eventKey': cmd.eventKey,
'eventClass': cmd.eventClass,
'command_output': cmd.result.output,
'exception': str(ex),
No changes.
@@ -16,7 +16,8 @@
from Products.ZenTestCase.BaseTestCase import BaseTestCase
from Products.ZenRRD.tests.BaseParsersTestCase import Object
from Products.ZenRRD.CommandParser import ParsedResults
-from Products.ZenRRD.parsers.JSON import JSON
+
+from ZenPacks.zenoss.oVirt.parsers.JSONParser import JSONParser
class TestJSONParser(BaseTestCase):
@@ -32,10 +33,11 @@ def setUp(self):
self.cmd.result = Object()
self.cmd.result.exitCode = 0
self.cmd.severity = 2
+ self.cmd.eventKey = 'oVirt'
self.cmd.eventClass = '/Cmd'
self.cmd.command = "testJSONCommand"
self.cmd.points = []
- self.parser = JSON()
+ self.parser = JSONParser()
self.results = ParsedResults()
def test_json_parse_error(self):
@@ -52,7 +54,7 @@ def test_json_parse_error(self):
self.assertEquals(event['severity'], self.cmd.severity)
self.assertEquals(event['summary'], 'error parsing command output')
- self.assertEquals(event['eventKey'], self.cmd.command)
+ self.assertEquals(event['eventKey'], self.cmd.eventKey)
self.assertEquals(event['eventClass'], self.cmd.eventClass)
self.assertEquals(event['command_output'], self.cmd.result.output)
self.assertTrue('exception' in event)
@@ -168,4 +170,3 @@ def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(TestJSONParser))
return suite
-
View
@@ -3,7 +3,7 @@
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.zenoss.oVirt"
-VERSION = "1.1.3"
+VERSION = "1.1.4"
AUTHOR = "Zenoss Labs <labs@zenoss.com>"
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.zenoss']

0 comments on commit d1ee2f5

Please sign in to comment.