fog-openstack icon indicating copy to clipboard operation
fog-openstack copied to clipboard

inconsistent model-collection methods to get by id

Open plribeiro3000 opened this issue 9 years ago • 1 comments
trafficstars

In Fog, the model collections classes (typically the pluralised names in lib/fog/provider/models/service) have a get(id) method to fetch a model object by its ID. In the case where the ID cannot be found, the get(id) method typically swallows the NotFound exception and returns nil.

In the OpenStack provider case, some classes use get(id) as described above, some use get(id) but do not swallow the NotFound exception, some classes use find_by_id(id) and not not swallow the exception, and in one case both methods are supported with find_by_id being marked as deprecated.

In other words, there is a great deal of inconsistency in how to get a model object by its ID in the Fog OpenStack provider.

Original issue opened by @hague at fog/fog#3726

plribeiro3000 avatar Mar 10 '16 19:03 plribeiro3000

cc/ @dhague @Ladas @geemus

plribeiro3000 avatar Mar 10 '16 19:03 plribeiro3000