[tempest] urllib failure running under py3

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

Bug Description

When running manila-tempest-plugin under python3 we encounter the following error because the urllib2 module isn't available in python3:

2019-01-05 17:36:55.749712 | controller | 2019-01-05 17:36:55.749 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L135: echo 'Running tempest manila test suites'
2019-01-05 17:36:55.751300 | controller | 2019-01-05 17:36:55.750 | Running tempest manila test suites
2019-01-05 17:36:55.752798 | controller | 2019-01-05 17:36:55.752 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L136: [[ api == \a\p\i ]]
2019-01-05 17:36:55.754862 | controller | 2019-01-05 17:36:55.754 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L137: export MANILA_TESTS=manila_tempest_tests.tests.api
2019-01-05 17:36:55.757179 | controller | 2019-01-05 17:36:55.756 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L137: MANILA_TESTS=manila_tempest_tests.tests.api
2019-01-05 17:36:55.759580 | controller | 2019-01-05 17:36:55.759 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L141: export MANILA_TEMPEST_CONCURRENCY=12
2019-01-05 17:36:55.761926 | controller | 2019-01-05 17:36:55.761 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L141: MANILA_TEMPEST_CONCURRENCY=12
2019-01-05 17:36:55.764743 | controller | 2019-01-05 17:36:55.764 | ++ /opt/stack/new/devstack-plugin-ceph/manila/post_test_hook.sh:source:L143: sudo -H -u zuul tempest run -r manila_tempest_tests.tests.api --concurrency=12
2019-01-05 17:36:55.766713 | controller | 2019-01-05 17:36:55.766 | /usr/local/lib/python3.6/dist-packages/eventlet/patcher.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
2019-01-05 17:36:55.768089 | controller | 2019-01-05 17:36:55.767 | import imp
2019-01-05 17:36:55.770783 | controller | 2019-01-05 17:36:55.770 | sys:1: ResourceWarning: unclosed file <_io.FileIO name=1 mode='wb' closefd=True>
2019-01-05 17:36:55.772772 | controller | 2019-01-05 17:36:55.772 |
2019-01-05 17:36:55.774678 | controller | 2019-01-05 17:36:55.774 | =========================
2019-01-05 17:36:55.776333 | controller | 2019-01-05 17:36:55.775 | Failures during discovery
2019-01-05 17:36:55.778802 | controller | 2019-01-05 17:36:55.778 | =========================
2019-01-05 17:36:55.780740 | controller | 2019-01-05 17:36:55.780 | --- import errors ---
2019-01-05 17:36:55.783034 | controller | 2019-01-05 17:36:55.782 | Failed to import test module: manila_tempest_tests.tests.scenario.test_share_basic_ops
2019-01-05 17:36:55.784887 | controller | 2019-01-05 17:36:55.784 | Traceback (most recent call last):
2019-01-05 17:36:55.786730 | controller | 2019-01-05 17:36:55.786 | File "/usr/local/lib/python3.6/dist-packages/unittest2/loader.py", line 456, in _find_test_path
2019-01-05 17:36:55.788498 | controller | 2019-01-05 17:36:55.787 | module = self._get_module_from_name(name)
2019-01-05 17:36:55.791113 | controller | 2019-01-05 17:36:55.790 | File "/usr/local/lib/python3.6/dist-packages/unittest2/loader.py", line 395, in _get_module_from_name
2019-01-05 17:36:55.793417 | controller | 2019-01-05 17:36:55.792 | __import__(name)
2019-01-05 17:36:55.795499 | controller | 2019-01-05 17:36:55.794 | File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/tests/scenario/test_share_basic_ops.py", line 26, in <module>
2019-01-05 17:36:55.797707 | controller | 2019-01-05 17:36:55.797 | from manila_tempest_tests.tests.scenario import manager_share as manager
2019-01-05 17:36:55.800063 | controller | 2019-01-05 17:36:55.799 | File "/opt/stack/new/manila-tempest-plugin/manila_tempest_tests/tests/scenario/manager_share.py", line 31, in <module>
2019-01-05 17:36:55.801857 | controller | 2019-01-05 17:36:55.801 | from urllib2 import urlopen
2019-01-05 17:36:55.803894 | controller | 2019-01-05 17:36:55.803 | ModuleNotFoundError: No module named 'urllib2'
2019-01-05 17:36:55.806091 | controller | 2019-01-05 17:36:55.805 |
2019-01-05 17:36:55.808331 | controller | 2019-01-05 17:36:55.807 | ================================================================================
2019-01-05 17:36:55.810117 | controller | 2019-01-05 17:36:55.809 | The above traceback was encountered during test discovery which imports all the found test modules in the specified test_path.

Tom Barron (tpb)
Changed in manila:
status: New → Confirmed
milestone: none → stein-2
importance: Undecided → High
tags: added: python3 tempest tests
Changed in manila:
assignee: nobody → Tom Barron (tpb)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila-tempest-plugin (master)

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

commit 8e9a39abbf0bfff5448422dc1bcc6bddb7682355
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jan 4 12:26:26 2019 -0800

    Py3: Use urlopen from six.moves.urllib.request

    Namespaces within the urllib2 package have
    changed between python2x and python3x.

    Closes-bug: #1810610
    Change-Id: I2a044ba76970393c587d6bc8d07280a7727bbe21

Changed in manila:
status: In Progress → Fix Released
Tom Barron (tpb)
summary: - tempest urllib failure running under py3
+ [tempest] urllib failure running under py3
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.