Add bug number subject parsing
This commit adds bug number subject parsing the bug msg processing so we properly handle setting the bug number in the mqtt topic.
This commit is contained in:
parent
b278fa0008
commit
314c1cb2d8
|
@ -13,6 +13,8 @@
|
|||
# under the License.
|
||||
|
||||
import email
|
||||
import re
|
||||
|
||||
import imaplib2 as imaplib
|
||||
|
||||
|
||||
|
@ -41,6 +43,9 @@ class LPImapWatcher(object):
|
|||
event['bug-reporter'] = message['X-Launchpad-Bug-Reporter']
|
||||
event['bug-modifier'] = message['X-Launchpad-Bug-Modifier']
|
||||
event['tags'] = message['X-Launchpad-Bug-Tags'].split(' ')
|
||||
subject = message['Subject']
|
||||
bug_num_str = re.match('^\[(.*?)\]', subject).group(0)
|
||||
event['bug-number'] = bug_num_str.split(' ')[1].rstrip(']')
|
||||
bug_info = message['X-Launchpad-Bug'].split(';')
|
||||
for info in bug_info:
|
||||
clean_info = info.lstrip()
|
||||
|
|
Loading…
Reference in New Issue