]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix bad except clauses order
authormasahiro ikeda <ikedamsh@nttdata.co.jp>
Fri, 21 Aug 2015 05:31:24 +0000 (14:31 +0900)
committermasahiro ikeda <ikedamsh@nttdata.co.jp>
Mon, 24 Aug 2015 07:05:01 +0000 (16:05 +0900)
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

index 46b0a583ff8cb80cdabf744561502d41f392af4f..154f48b5eb3fa24250e5e739b383db0c1b125547 100644 (file)
@@ -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