Merge "Do not suppress all exceptions"
This commit is contained in:
commit
0cc9fdc61d
@ -15,6 +15,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
from datetime import datetime
|
||||
import errno
|
||||
import json
|
||||
import os.path
|
||||
import pyghmi.constants as pygconst
|
||||
@ -25,6 +26,7 @@ import pyghmi.ipmi.private.util as util
|
||||
import pyghmi.ipmi.sdr as sdr
|
||||
import pyghmi.util.webclient as webclient
|
||||
import random
|
||||
import socket
|
||||
import struct
|
||||
import threading
|
||||
import urllib
|
||||
@ -137,7 +139,9 @@ class IMMClient(object):
|
||||
wc = webclient.SecureHTTPConnection(self.imm, 443, verifycallback=cv)
|
||||
try:
|
||||
wc.connect()
|
||||
except Exception:
|
||||
except socket.error as se:
|
||||
if se.errno != errno.ECONNREFUSED:
|
||||
raise
|
||||
return None
|
||||
adata = urllib.urlencode({'user': self.username,
|
||||
'password': self.password,
|
||||
@ -455,7 +459,9 @@ class XCCClient(IMMClient):
|
||||
wc = webclient.SecureHTTPConnection(self.imm, 443, verifycallback=cv)
|
||||
try:
|
||||
wc.connect()
|
||||
except Exception:
|
||||
except socket.error as se:
|
||||
if se.errno != errno.ECONNREFUSED:
|
||||
raise
|
||||
return None
|
||||
adata = json.dumps({'username': self.username,
|
||||
'password': self.password
|
||||
|
Loading…
Reference in New Issue
Block a user