diff --git a/novaclient/flavors.py b/novaclient/flavors.py index 50c962eab..cf60c602c 100644 --- a/novaclient/flavors.py +++ b/novaclient/flavors.py @@ -28,6 +28,14 @@ class FlavorManager(base.ManagerWithFind): :rtype: list of :class:`Flavor`. """ return self._list("/flavors/detail", "flavors") + + def list_undetailed(self): + """ + Get a list of all flavors. + + :rtype: list of :class:`Flavor`. + """ + return self._list("/flavors", "flavors") def get(self, flavor): """ diff --git a/tests/test_flavors.py b/tests/test_flavors.py index b2f286045..7a40ac5c1 100644 --- a/tests/test_flavors.py +++ b/tests/test_flavors.py @@ -12,6 +12,12 @@ def test_list_flavors(): [assert_isinstance(f, Flavor) for f in fl] +def test_list_flavors_undetailed(): + fl = cs.flavors.list_undetailed() + cs.assert_called('GET', '/flavors') + [assert_isinstance(f, Flavor) for f in fl] + + def test_get_flavor_details(): f = cs.flavors.get(1) cs.assert_called('GET', '/flavors/1')