Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(141)

Unified Diff: plaso/parsers/syslog_plugins/ssh.py

Issue 332660043: [plaso] Code clean up of syslog plugins (Closed)
Patch Set: Changes Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « plaso/parsers/syslog_plugins/cron.py ('k') | tests/parsers/syslog_plugins/cron.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plaso/parsers/syslog_plugins/ssh.py
diff --git a/plaso/parsers/syslog_plugins/ssh.py b/plaso/parsers/syslog_plugins/ssh.py
index 5ddc896ee506450021e6ac07a84b7268263a76c4..08baafd199d7694b0e2d7b617ee8d03f91c1af82 100644
--- a/plaso/parsers/syslog_plugins/ssh.py
+++ b/plaso/parsers/syslog_plugins/ssh.py
@@ -54,8 +54,9 @@ class SSHOpenedConnectionEventData(SSHEventData):
DATA_TYPE = 'syslog:ssh:opened_connection'
-class SSHPlugin(interface.SyslogPlugin):
+class SSHSyslogPlugin(interface.SyslogPlugin):
"""A plugin for creating events from syslog message produced by SSH."""
+
NAME = 'ssh'
DESCRIPTION = 'Parser for SSH syslog entries.'
REPORTER = 'sshd'
@@ -124,11 +125,10 @@ class SSHPlugin(interface.SyslogPlugin):
the defined grammar.
Raises:
- AttributeError: If an unknown key is provided.
+ ValueError: If an unknown key is provided.
"""
- # TODO: change AttributeError into ValueError or equiv.
if key not in ('failed_connection', 'login', 'opened_connection'):
- raise AttributeError('Unknown grammar key: {0:s}'.format(key))
+ raise ValueError('Unknown grammar key: {0:s}'.format(key))
if key == 'login':
event_data = SSHLoginEventData()
@@ -159,4 +159,4 @@ class SSHPlugin(interface.SyslogPlugin):
parser_mediator.ProduceEventWithEventData(event, event_data)
-syslog.SyslogParser.RegisterPlugin(SSHPlugin)
+syslog.SyslogParser.RegisterPlugin(SSHSyslogPlugin)
« no previous file with comments | « plaso/parsers/syslog_plugins/cron.py ('k') | tests/parsers/syslog_plugins/cron.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b