runabove/python-runabove — pull request #5 by yadutaf (2014-09-09 21:48:32+00:00)
Title: add get_by_name method to flavors and images

It usually is much easier (and readable) to remember objects name than remember object ids. This pull request adds convenience ``get_by_name`` methods to ``FlavorManager`` and ``ImageManager``. As multiple objects may share the same name, it returns a possibly empty list of matching object instances.

Due to API design, theses methods may be slow, should the number of flavors or images be important. In practice, this is not an issue as images and flavors list are usually kept "reasonably" small. If it became an issue for a user, it should be pretty easy to either plug in an image/flavor id cache or simply switch to raw ids directly.