]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python3: cast the result of zip() to list
authorCyril Roelandt <cyril@redhat.com>
Tue, 7 Jul 2015 14:25:06 +0000 (14:25 +0000)
committerCyril Roelandt <cyril@redhat.com>
Tue, 7 Jul 2015 14:32:14 +0000 (16:32 +0200)
The result of get_sorts was a 'zip object' in Python 3, and it was later used
as a list, which fails. Just cast the result to a list to fix this issue.

Change-Id: I12017f79cad92b1da4fe5f9939b38436db7219eb
Blueprint: neutron-python3

neutron/api/api_common.py

index 778c40794daa3e4c206b4d802ae1e4de8ee9d55d..595c592bd72bd463938e9e5634ae97adb6d99cd5 100644 (file)
@@ -147,8 +147,8 @@ def get_sorts(request, attr_info):
                 'asc': constants.SORT_DIRECTION_ASC,
                 'desc': constants.SORT_DIRECTION_DESC})
         raise exc.HTTPBadRequest(explanation=msg)
-    return zip(sort_keys,
-               [x == constants.SORT_DIRECTION_ASC for x in sort_dirs])
+    return list(zip(sort_keys,
+                    [x == constants.SORT_DIRECTION_ASC for x in sort_dirs]))
 
 
 def get_page_reverse(request):