Fixes list_snapshots and _with_details methods in snap XML client
Listing was not stripping outer 'snapshots' tag before return
Change-Id: Ic95ed3b9f3f5c164f191c2445be611db2135ca54
Fixes: bug #1177610
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index 410ed3e..b35c43e 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -48,7 +48,10 @@
resp, body = self.get(url, self.headers)
body = etree.fromstring(body)
- return resp, xml_to_json(body)
+ snapshots = []
+ for snap in body:
+ snapshots.append(xml_to_json(snap))
+ return resp, snapshots
def list_snapshots_with_detail(self, params=None):
"""List all the details of snapshot."""
@@ -60,7 +63,9 @@
resp, body = self.get(url, self.headers)
body = etree.fromstring(body)
snapshots = []
- return resp, snapshots(xml_to_json(body))
+ for snap in body:
+ snapshots.append(xml_to_json(snap))
+ return resp, snapshots
def get_snapshot(self, snapshot_id):
"""Returns the details of a single snapshot."""