BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401202 )

Change subject: Guard against degenerate messages in #wikimedia-cloud
......................................................................

Guard against degenerate messages in #wikimedia-cloud

Change-Id: I1a06d3bf807bda5772f328dc91c9d3f19448ee95
---
M stashbot/sal.py
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/stashbot 
refs/changes/02/401202/1

diff --git a/stashbot/sal.py b/stashbot/sal.py
index 850b5ce..8595040 100644
--- a/stashbot/sal.py
+++ b/stashbot/sal.py
@@ -91,7 +91,17 @@
             bang['nick'], bang['message'] = bang['message'].split(None, 1)
 
         if channel in ['#wikimedia-labs', '#wikimedia-cloud']:
-            bang['project'], bang['message'] = bang['message'].split(None, 1)
+            parts = bang['message'].split(None, 1)
+            if len(parts) < 2:
+                if respond_to_channel:
+                    self.irc.respond(
+                        conn, event,
+                        ('%s: Missing project or message? '
+                        'Expected !log <project> <message>') % bang['nick']
+                    )
+                return
+
+            bang['project'], bang['message'] = parts
             if bang['project'] not in self._get_projects():
                 self.logger.warning('Invalid project "%s"', bang['project'])
                 if respond_to_channel:

-- 
To view, visit https://gerrit.wikimedia.org/r/401202
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a06d3bf807bda5772f328dc91c9d3f19448ee95
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stashbot
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to