summaryrefslogtreecommitdiff
path: root/contrib/cirrus/podbot.py
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-22 16:57:54 +0200
committerGitHub <noreply@github.com>2019-09-22 16:57:54 +0200
commitc0eff1a81c2718498aa8e75f7e45bfb688c91482 (patch)
tree3b83511c5d9072b9dc7ed6e2a9733b98b778491a /contrib/cirrus/podbot.py
parent0d95e3aa06baf0613addc69b3d01bb7c262abd34 (diff)
parent33b3d2914f1f8a76751ccd5aa873fc4e7b05f344 (diff)
downloadpodman-c0eff1a81c2718498aa8e75f7e45bfb688c91482.tar.gz
podman-c0eff1a81c2718498aa8e75f7e45bfb688c91482.tar.bz2
podman-c0eff1a81c2718498aa8e75f7e45bfb688c91482.zip
Merge pull request #4071 from cevich/more_podbot
Cirrus: More podbot/success improvements
Diffstat (limited to 'contrib/cirrus/podbot.py')
-rwxr-xr-xcontrib/cirrus/podbot.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/cirrus/podbot.py b/contrib/cirrus/podbot.py
index 1be41a8ed..9ca4915a7 100755
--- a/contrib/cirrus/podbot.py
+++ b/contrib/cirrus/podbot.py
@@ -12,7 +12,7 @@ import sys
class IRC:
- response_timeout = 10 # seconds
+ response_timeout = 30 # seconds
irc = socket.socket()
def __init__(self, server, nickname, channel):
@@ -90,9 +90,16 @@ class IRC:
if len(sys.argv) < 3:
print("Error: Must pass desired nick and message as parameters")
else:
- irc = IRC("irc.freenode.net", sys.argv[1], "#podman")
- err = irc.connect(*os.environ.get('IRCID', 'Big Bug').split(" ", 2))
- if not err:
+ for try_again in (True,False):
+ irc = IRC("irc.freenode.net", sys.argv[1], "#podman")
+ err = irc.connect(*os.environ.get('IRCID', 'Big Bug').split(" ", 2))
+ if err and try_again:
+ print("Trying again in 5 seconds...")
+ time.sleep(5)
+ continue
+ elif err:
+ break
irc.message(" ".join(sys.argv[2:]))
time.sleep(5.0) # avoid join/quit spam
irc.quit()
+ break