----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/27032/#review57787 -----------------------------------------------------------
``` def brokerConnectionFailed(self, broker, e): """ Invoked when a connection to a broker fails """ if self.first_connect: self.first_connect = None print "Failed to connect: ", e ``` If you set self.first_connect to None here there will be no "Broker connected:" message when the broker does actually connect. You may want a separate variable to control the printing of the "Failed to connect:" message. - Ernie Allen On Oct. 22, 2014, 1:38 p.m., Pavel Moravec wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/27032/ > ----------------------------------------------------------- > > (Updated Oct. 22, 2014, 1:38 p.m.) > > > Review request for qpid, Ernie Allen, Kenneth Giusti, and Ted Ross. > > > Bugs: QPID-6177 > https://issues.apache.org/jira/browse/QPID-6177 > > > Repository: qpid > > > Description > ------- > > Simple patch that overwrites default empty brokerConnectionFailed method > raised when connection fails. It makes sense to react only when connecting > for the first time. > > Changes in package imports are irrelevant to this JIRA - I had to do the > change to let qpid-tool to start working on trunk (?). > > As the logic of QMF console is to retry failed connections, I suggest just > raising some warning than directly stopping qpid-tool. > > > Diffs > ----- > > trunk/qpid/extras/qmf/src/py/qmf/console.py 1633165 > trunk/qpid/tools/src/py/qpid-tool 1633165 > > Diff: https://reviews.apache.org/r/27032/diff/ > > > Testing > ------- > > Testing with invalid hostname: > > $ ./tools/src/py/qpid-tool invalidHost > Management Tool for QPID > qpid: Failed to connect: [Errno -2] Name or service not known > > > Testing with no SASL mech in common: > > $ ./tools/src/py/qpid-tool > Management Tool for QPID > qpid: Failed to connect: (None, 'sasl negotiation failed: no mechanism > agreed') > > > Thanks, > > Pavel Moravec > >