From: masahiro ikeda Date: Fri, 21 Aug 2015 05:31:24 +0000 (+0900) Subject: Fix bad except clauses order X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7a6c63a51770f915d76fe77cb3419555197e94ca;p=openstack-build%2Fcinder-build.git 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 --- 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