]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Bad exception clauses order
authorRavi Shekhar Jethani <ravishekar.jethani@nttdata.com>
Tue, 17 Nov 2015 09:07:48 +0000 (01:07 -0800)
committerRavi Shekhar Jethani <ravishekar.jethani@nttdata.com>
Tue, 17 Nov 2015 09:45:56 +0000 (01:45 -0800)
A superclass exception (error) is being handled before
a sub class exception(SSLError) which is making the latter
exception clause unreachable. Corrected the order of these
exception clauses.

Trivial Fix
Change-Id: I82e6f4984b095f50cdd7ffccd9af60ce75d41f7f

cinder/volume/drivers/emc/emc_vmax_https.py

index 348186c853a1fafef4f6f9b1131f242c4d4f87b2..aa9584f477038cc1cb8bf5618dcf080d806e6e69 100644 (file)
@@ -333,14 +333,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