From 7a6c63a51770f915d76fe77cb3419555197e94ca Mon Sep 17 00:00:00 2001 From: masahiro ikeda Date: Fri, 21 Aug 2015 14:31:24 +0900 Subject: [PATCH] Fix bad except clauses order In wbem_request() method, 'socket.error' superclass of exception class ' socket.sslerror' has already been caught. Moved the except 'socket.sslerror' block up above 'socket.error' so that if there is any error due to ssl it is caught correctly. Closes-Bug: #1487320 Change-Id: I1de1642e47fc7ba39e6666fca1aa6e8d0dde57d7 --- cinder/volume/drivers/emc/emc_vmax_https.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cinder/volume/drivers/emc/emc_vmax_https.py b/cinder/volume/drivers/emc/emc_vmax_https.py index 46b0a583f..154f48b5e 100644 --- a/cinder/volume/drivers/emc/emc_vmax_https.py +++ b/cinder/volume/drivers/emc/emc_vmax_https.py @@ -332,14 +332,14 @@ def wbem_request(url, data, creds, headers=None, debug=0, x509=None, msg = (_("Bad Status line returned: %(arg)s.") % {'arg': arg}) raise pywbem.cim_http.Error(msg) - except socket.error as arg: - msg = (_("Socket error:: %(arg)s.") - % {'arg': arg}) - raise pywbem.cim_http.Error(msg) except socket.sslerror as arg: msg = (_("SSL error: %(arg)s.") % {'arg': arg}) raise pywbem.cim_http.Error(msg) + except socket.error as arg: + msg = (_("Socket error: %(arg)s.") + % {'arg': arg}) + raise pywbem.cim_http.Error(msg) break -- 2.45.2