Hi
In the LBaaS DB layer there is a utility method (‘_get_resource’) that takes 
entity type and the entity id and fetch it from DB.
If the entity  can’t be found in DB the method  throws a specific exception.

Example:
If we were looking for a Pool and it was not found in DB --> throw PoolNotFound
If we were looking for a HealthMonitor and it was not found in DB --> throw 
HealthMonitorNotFound
etc…

I can see very little value (if any…) in having those specific exceptions.

Why not have a base “NotFound” exception that gets the entity type and its id.
This exception will tell the method caller what is the  entity type and its id. 
Isnt that good enough?

On the other hand this code should be mainlined and reviewed… So not only it 
has no value, the dev. team  should maintain it.

Here is the code (v1) 
https://github.com/openstack/neutron/blob/master/neutron/db/loadbalancer/loadbalancer_db.py#L210
I prefer not to have it in v2

Thanks

Avishay







_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to