]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
replace exception handler by using cisco_exceptions
authorYing Liu <yinliu2@cisco.com>
Fri, 19 Aug 2011 20:37:33 +0000 (13:37 -0700)
committerYing Liu <yinliu2@cisco.com>
Fri, 19 Aug 2011 20:37:33 +0000 (13:37 -0700)
extensions/credential.py
extensions/novatenant.py
extensions/portprofile.py
extensions/qos.py

index 8b51c81c2d8c5c3a4a831d6e6244d4ca8ba9c4d3..85043940b4451222ca2ae2189286ed98de72caa9 100644 (file)
@@ -22,7 +22,8 @@ import logging
 
 from webob import exc
 from extensions import _credential_view as credential_view
-from extensions import _exceptions as exception
+from quantum.plugins.cisco.common import cisco_exceptions as exception
+#from extensions import _exceptions as exception
 from extensions import _faults as faults
 
 from quantum.api import api_common as common
index eddab4c17f5ff797c8713b6ee12803e4287086bc..5cbfc4bd0a1282266d6630690d34cfa439eca988 100644 (file)
@@ -21,7 +21,8 @@
 from webob import exc
 
 from extensions import _novatenant_view as novatenant_view
-from extensions import _exceptions as exception
+from quantum.common import exceptions as qexception
+#from extensions import _exceptions as exception
 from extensions import _faults as faults
 
 from quantum.api import api_common as common
@@ -144,9 +145,7 @@ class NovatenantsController(common.QuantumController):
             result = builder.build_host(host)
             return result
             #return exc.HTTPAccepted()
-        except exception.NovatenantNotFound as exp:
-            return faults.Fault(faults.NovatenantNotFound(exp))
-        except exception.PortNotFound as exp:
+        except qexception.PortNotFound as exp:
             return faults.Fault(faults.PortNotFound(exp))
         
     def get_instance_port(self, request, tenant_id, id):
@@ -169,7 +168,5 @@ class NovatenantsController(common.QuantumController):
             result = builder.build_vif(vif)
             return result
             
-        except exception.NovatenantNotFound as exp:
-            return faults.Fault(faults.NovatenantNotFound(exp))
-        except exception.PortNotFound as exp:
+        except qexception.PortNotFound as exp:
             return faults.Fault(faults.PortNotFound(exp))
index 8186f6903db1f6f6597d4cff838b208d0f004462..b0fbb65dd699d8651246876706feb4863d41f62c 100644 (file)
@@ -22,7 +22,9 @@
 from webob import exc
 
 from extensions import _pprofiles as pprofiles_view
-from extensions import _exceptions as exception
+from quantum.plugins.cisco.common import cisco_exceptions as exception
+from quantum.common import exceptions as qexception
+#from extensions import _exceptions as exception
 from extensions import _faults as faults
 
 from quantum.api import api_common as common
@@ -126,7 +128,7 @@ class PortprofilesController(common.QuantumController):
             #build response with details
             result = builder.build(portprofile, True)
             return dict(portprofiles=result)
-        except exception.PortprofileNotFound as exp:
+        except exception.PortProfileNotFound as exp:
             return faults.Fault(faults.PortprofileNotFound(exp))
             #return faults.Fault(exp)
 
@@ -163,7 +165,7 @@ class PortprofilesController(common.QuantumController):
             builder = pprofiles_view.get_view_builder(request)
             result = builder.build(portprofile, True)
             return dict(portprofiles=result)
-        except exception.PortprofileNotFound as exp:
+        except exception.PortProfileNotFound as exp:
             return faults.Fault(faults.PortprofileNotFound(exp))
 
     def delete(self, request, tenant_id, id):
@@ -171,7 +173,7 @@ class PortprofilesController(common.QuantumController):
         try:
             self._plugin.delete_portprofile(tenant_id, id)
             return exc.HTTPAccepted()
-        except exception.PortprofileNotFound as exp:
+        except exception.PortProfileNotFound as exp:
             return faults.Fault(faults.PortprofileNotFound(exp))
          
     def associate_portprofile(self, request, tenant_id, id):
@@ -193,9 +195,9 @@ class PortprofilesController(common.QuantumController):
                                                 net_id, port_id,
                                                 id)
             return exc.HTTPAccepted()
-        except exception.PortprofileNotFound as exp:
+        except exception.PortProfileNotFound as exp:
             return faults.Fault(faults.PortprofileNotFound(exp))
-        except exception.PortNotFound as exp:
+        except qexception.PortNotFound as exp:
             return faults.Fault(faults.PortNotFound(exp))
         
     def disassociate_portprofile(self, request, tenant_id, id):
@@ -217,7 +219,7 @@ class PortprofilesController(common.QuantumController):
             disassociate_portprofile(tenant_id,
                                     net_id, port_id, id)
             return exc.HTTPAccepted()
-        except exception.PortprofileNotFound as exp:
+        except exception.PortProfileNotFound as exp:
             return faults.Fault(faults.PortprofileNotFound(exp))
-        except exception.PortNotFound as exp:
+        except qexception.PortNotFound as exp:
             return faults.Fault(faults.PortNotFound(exp))
index a11f41af7797733279398811fc94b6d765e1da10..3c0f3da7829df6bba88643b830cbfac29c2c60f0 100644 (file)
@@ -22,7 +22,8 @@ import logging
 
 from webob import exc
 from extensions import _qos_view as qos_view
-from extensions import _exceptions as exception
+from quantum.plugins.cisco.common import cisco_exceptions as exception
+from extensions import _exceptions as exte
 from extensions import _faults as faults
 
 from quantum.api import api_common as common