From: Dyre Tjeldvoll Date: January 15 2013 9:29am Subject: bzr push into mysql-5.5-cluster-7.2 branch (Dyre.Tjeldvoll:4157 to 4158) List-Archive: http://lists.mysql.com/commits/145608 Message-Id: <20130115092900.13095.97280.4158@khepri17.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4158 Dyre Tjeldvoll 2013-01-15 Fix regression caused by WSA errnos not being defined on other OSes modified: storage/ndb/mcc/tst/tst_main.py storage/ndb/mcc/util.py 4157 Dyre Tjeldvoll 2013-01-14 Add Windows specific error code and skip fg_exec test (for now) modified: storage/ndb/mcc/clusterhost.py storage/ndb/mcc/tst/tst_main.py storage/ndb/mcc/util.py === modified file 'storage/ndb/mcc/tst/tst_main.py' --- a/storage/ndb/mcc/tst/tst_main.py 2013-01-14 14:58:29 +0000 +++ b/storage/ndb/mcc/tst/tst_main.py 2013-01-15 09:28:10 +0000 @@ -81,7 +81,10 @@ def mock_ABClusterHost(hle): return produce_ABClusterHost(hostname=hle['hostInfoRep']['host']['name'], user=util.get_val(hle, 'username'), pwd=util.get_val(hle, 'password')) def host_is_unreachable(hostname, port=22): - return util.try_connect(hostname, port, False, retdict={ socket.EAI_NONAME : True}) + rd = util._retdict('ECONNREFUSED', True) + rd[socket.EAI_NONAME] = True + + return util.try_connect(hostname, port, False, rd) def is_local_sshd_available(): c = SSHClient() === modified file 'storage/ndb/mcc/util.py' --- a/storage/ndb/mcc/util.py 2013-01-14 14:58:29 +0000 +++ b/storage/ndb/mcc/util.py 2013-01-15 09:28:10 +0000 @@ -61,12 +61,19 @@ def try_connect(url_host, port, success= if s: s.shutdown(socket.SHUT_RDWR) s.close() + +def _retdict(name, val): + rd = { getattr(errno,name) : val } + wsa = 'WSA'+name + if hasattr(errno, wsa): + rd[getattr(errno, wsa)] = val + return rd def is_port_available(url_host,port): """Predicate for determining if a port is available. Returns False if connection to url_host,port succeeds, and True if it throws connection refused.""" - return try_connect(url_host, port, False, {errno.ECONNREFUSED: True, errno.WSAECONNREFUSED: True}) + return try_connect(url_host, port, False, _retdict('ECONNREFUSED', True)) class NoPortAvailableException(Exception): """Exception thrown if no unused port can be found.""" No bundle (reason: useless for push emails).