jabber_mirror: Exit if we fail to connect to the Jabber server

(imported from commit f5cc600325a3547412cf0b05239c988410354c10)
This commit is contained in:
Zev Benjamin 2014-02-28 14:00:03 -05:00
parent 0dd209c813
commit 2850800e48
1 changed files with 4 additions and 1 deletions

View File

@ -236,7 +236,10 @@ user and mirrors messages sent to Jabber rooms to Zulip.'''.replace("\n", " "))
xmpp = JabberToZulipBot(options.jabber_username, options.jabber_domain, xmpp = JabberToZulipBot(options.jabber_username, options.jabber_domain,
options.jabber_password, rooms, options.jabber_password, rooms,
openfire=options.openfire) openfire=options.openfire)
xmpp.connect(use_tls=not options.no_use_tls)
if not xmpp.connect(use_tls=not options.no_use_tls):
sys.exit("Unable to connect to Jabber server")
xmpp.set_zulip_client(zulip) xmpp.set_zulip_client(zulip)
zulip.set_jabber_client(xmpp) zulip.set_jabber_client(xmpp)