[tempest] type error on filter object running under py3

Bug #1810937 reported by Tom Barron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Tom Barron

Bug Description

When running manila tempest tests under python3 there are exceptions in the manila-tempest-plugin code like the following:

2019-01-08 11:53:23.481749 | controller | 2019-01-08 11:53:23.481 | manila_tempest_tests.tests.api.test_snapshot_rules.ShareSnapshotUserRulesForCIFSTest.test_create_delete_access_rules[backend,positive]
2019-01-08 11:53:23.483592 | controller | 2019-01-08 11:53:23.483 | --------------------------------------------------------------------------------------------------------------------------------------
2019-01-08 11:53:23.485212 | controller | 2019-01-08 11:53:23.484 |
2019-01-08 11:53:23.487127 | controller | 2019-01-08 11:53:23.486 | Captured traceback:
2019-01-08 11:53:23.489239 | controller | 2019-01-08 11:53:23.488 | ~~~~~~~~~~~~~~~~~~~
2019-01-08 11:53:23.491319 | controller | 2019-01-08 11:53:23.490 | b'Traceback (most recent call last):'
2019-01-08 11:53:23.494070 | controller | 2019-01-08 11:53:23.493 | b' File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/tests/api/test_snapshot_rules.py", line 108, in test_create_delete_access_rules'
2019-01-08 11:53:23.496145 | controller | 2019-01-08 11:53:23.495 | b' self._test_create_delete_access_rules(access_to)'
2019-01-08 11:53:23.498280 | controller | 2019-01-08 11:53:23.497 | b' File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/tests/api/test_snapshot_rules.py", line 54, in _test_create_delete_access_rules'
2019-01-08 11:53:23.500108 | controller | 2019-01-08 11:53:23.499 | b" self.snapshot['id'], rule['id'])"
2019-01-08 11:53:23.501958 | controller | 2019-01-08 11:53:23.501 | b' File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/services/share/v2/json/shares_client.py", line 1672, in wait_for_snapshot_access_rule_status'
2019-01-08 11:53:23.503796 | controller | 2019-01-08 11:53:23.503 | b' rule = self.get_snapshot_access_rule(snapshot_id, rule_id)'
2019-01-08 11:53:23.505583 | controller | 2019-01-08 11:53:23.505 | b' File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/services/share/v2/json/shares_client.py", line 1668, in get_snapshot_access_rule'
2019-01-08 11:53:23.507780 | controller | 2019-01-08 11:53:23.507 | b' return found_rules[0] if len(found_rules) > 0 else None'
2019-01-08 11:53:23.509751 | controller | 2019-01-08 11:53:23.509 | b"TypeError: object of type 'filter' has no len()"

Tom Barron (tpb)
tags: added: python3 tempest tests
Changed in manila:
milestone: none → stein-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila-tempest-plugin (master)

Fix proposed to branch: master
Review: https://review.openstack.org/629175

Changed in manila:
assignee: nobody → Tom Barron (tpb)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-tempest-plugin (master)

Reviewed: https://review.openstack.org/629175
Committed: https://git.openstack.org/cgit/openstack/manila-tempest-plugin/commit/?id=e5d788e46fb69e81d344679ab7928ce107580098
Submitter: Zuul
Branch: master

commit e5d788e46fb69e81d344679ab7928ce107580098
Author: Tom Barron <email address hidden>
Date: Tue Jan 8 08:06:49 2019 -0500

    Fix access-rule filter for python3

    The manila-tempest-plugin shares client collects access rules
    from a rest response body using a filter expression which in
    Python 3 is an iterator. It then attempts to determine the
    length of the result and since the full iteration has not
    completed, Python throws an exception.

    Fix this by using a straightforward list comprehension that
    behaves the same way in Python 2 and Python 3.

    Closes-bug: #1810937
    Change-Id: I20a1f05cd4e2f6bdee8b8e4b069c53e35e41fe70

Changed in manila:
status: In Progress → Fix Released
Jason Grosso (jgrosso)
Changed in manila:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila-tempest-plugin 0.2.0

This issue was fixed in the openstack/manila-tempest-plugin 0.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.