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/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 3a0c802..602209a 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import testtools
-
from tempest.api.volume import base
from tempest.common import log as logging
from tempest.common.utils.data_utils import rand_name
@@ -82,6 +80,5 @@
self.clear_snapshots()
-@testtools.skip("Until Bug #1177610 is resolved.")
class VolumesSnapshotTestXML(VolumesSnapshotTest):
_interface = "xml"
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."""