diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..b32d8aa7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +.idea \ No newline at end of file diff --git a/novaclient/flavors.py b/novaclient/flavors.py index 7004b73ec..bfede1e13 100644 --- a/novaclient/flavors.py +++ b/novaclient/flavors.py @@ -21,7 +21,7 @@ class FlavorManager(base.ManagerWithFind): """ resource_class = Flavor - def list(self, detailed=False): + def list(self, detailed=True): """ Get a list of all flavors. diff --git a/novaclient/images.py b/novaclient/images.py index 56333bb1d..3d19bff9f 100644 --- a/novaclient/images.py +++ b/novaclient/images.py @@ -35,7 +35,7 @@ class ImageManager(base.ManagerWithFind): """ return self._get("/images/%s" % base.getid(image), "image") - def list(self, detailed=False): + def list(self, detailed=True): """ Get a list of all images. diff --git a/novaclient/ipgroups.py b/novaclient/ipgroups.py index 29edf1337..86cd3cb43 100644 --- a/novaclient/ipgroups.py +++ b/novaclient/ipgroups.py @@ -20,7 +20,7 @@ class IPGroup(base.Resource): class IPGroupManager(base.ManagerWithFind): resource_class = IPGroup - def list(self, detailed=False): + def list(self, detailed=True): """ Get a list of all groups. @@ -29,7 +29,7 @@ class IPGroupManager(base.ManagerWithFind): detail = "" if detailed: detail = "/detail" - return self._list("/shared_ip_groups%s" % s, "sharedIpGroups") + return self._list("/shared_ip_groups%s" % detail, "sharedIpGroups") def get(self, group): """ diff --git a/novaclient/servers.py b/novaclient/servers.py index 50a51031c..8856458ab 100644 --- a/novaclient/servers.py +++ b/novaclient/servers.py @@ -187,7 +187,7 @@ class ServerManager(base.ManagerWithFind): """ return self._get("/servers/%s" % base.getid(server), "server") - def list(self, detailed=False): + def list(self, detailed=True): """ Get a list of servers. :rtype: list of :class:`Server` diff --git a/novaclient/zones.py b/novaclient/zones.py index 69bc72d94..d15dccb74 100644 --- a/novaclient/zones.py +++ b/novaclient/zones.py @@ -67,7 +67,7 @@ class ZoneManager(base.ManagerWithFind): """ return self._get("/zones/%s" % base.getid(zone), "zone") - def list(self, detailed=False): + def list(self, detailed=True): """ Get a list of child zones. :rtype: list of :class:`Zone` diff --git a/tests/test_flavors.py b/tests/test_flavors.py index 7a40ac5c1..cf4c6cfb8 100644 --- a/tests/test_flavors.py +++ b/tests/test_flavors.py @@ -13,7 +13,7 @@ def test_list_flavors(): def test_list_flavors_undetailed(): - fl = cs.flavors.list_undetailed() + fl = cs.flavors.list(detailed=False) cs.assert_called('GET', '/flavors') [assert_isinstance(f, Flavor) for f in fl] diff --git a/tests/test_images.py b/tests/test_images.py index 76c465919..1cc150a3f 100644 --- a/tests/test_images.py +++ b/tests/test_images.py @@ -12,6 +12,12 @@ def test_list_images(): [assert_isinstance(i, Image) for i in il] +def test_list_images_undetailed(): + il = cs.images.list(detailed=False) + cs.assert_called('GET', '/images') + [assert_isinstance(i, Image) for i in il] + + def test_get_image_details(): i = cs.images.get(1) cs.assert_called('GET', '/images/1') diff --git a/tests/test_ipgroups.py b/tests/test_ipgroups.py index 1f3719e0a..98a6f151d 100644 --- a/tests/test_ipgroups.py +++ b/tests/test_ipgroups.py @@ -12,6 +12,12 @@ def test_list_ipgroups(): [assert_isinstance(ipg, IPGroup) for ipg in ipl] +def test_list_ipgroups_undetailed(): + ipl = cs.ipgroups.list(detailed=False) + cs.assert_called('GET', '/shared_ip_groups') + [assert_isinstance(ipg, IPGroup) for ipg in ipl] + + def test_get_ipgroup(): ipg = cs.ipgroups.get(1) cs.assert_called('GET', '/shared_ip_groups/1') diff --git a/tests/test_servers.py b/tests/test_servers.py index ec1c08f88..221c836dc 100644 --- a/tests/test_servers.py +++ b/tests/test_servers.py @@ -13,6 +13,12 @@ def test_list_servers(): [assert_isinstance(s, Server) for s in sl] +def test_list_servers_undetailed(): + sl = cs.servers.list(detailed=False) + cs.assert_called('GET', '/servers') + [assert_isinstance(s, Server) for s in sl] + + def test_get_server_details(): s = cs.servers.get(1234) cs.assert_called('GET', '/servers/1234') diff --git a/tests/test_zones.py b/tests/test_zones.py index f8be79410..cd773ad3e 100644 --- a/tests/test_zones.py +++ b/tests/test_zones.py @@ -13,6 +13,12 @@ def test_list_zones(): [assert_isinstance(s, Zone) for s in sl] +def test_list_zones_undetailed(): + sl = os.zones.list(detailed=False) + os.assert_called('GET', '/zones') + [assert_isinstance(s, Zone) for s in sl] + + def test_get_zone_details(): s = os.zones.get(1) os.assert_called('GET', '/zones/1')