Add first pass of main file elasticRecheck.py
Currently monitors gerrit stream only.
This commit is contained in:
parent
1f20b9df5c
commit
1d101e3cd8
2
elasticRecheck.conf
Normal file
2
elasticRecheck.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[gerrit]
|
||||
user=jogo
|
31
elasticRecheck.py
Normal file
31
elasticRecheck.py
Normal file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import ConfigParser
|
||||
import sys
|
||||
|
||||
import gerritlib
|
||||
|
||||
def is_failed_tempest(event):
|
||||
if event.get('type', '') != 'comment-added':
|
||||
return False
|
||||
if event['author']['username'] == 'Jenkins':
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
config = ConfigParser.ConfigParser()
|
||||
config.read('elasticRecheck.conf')
|
||||
host = 'review.openstack.org'
|
||||
user = config.get('gerrit', 'user', 'jogo')
|
||||
port = 29418
|
||||
import gerritlib.gerrit
|
||||
gerrit = gerritlib.gerrit.Gerrit(host, user, port)
|
||||
gerrit.startWatching()
|
||||
while True:
|
||||
event = gerrit.getEvent()
|
||||
if is_failed_tempest(event):
|
||||
print event['comment']
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
x
Reference in New Issue
Block a user