py35 of masakari failed with error related to datetime

Bug #1753644 reported by takahara.kengo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Fix Released
Undecided
takahara.kengo

Bug Description

I executed 'tox -epy35', then the following errors occurred.

==============================
Failed 3 tests - output below:
==============================

masakari.tests.unit.objects.test_fields.TestDateTime.test_coerce_good_values
----------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_utils/timeutils.py", line 65, in parse_isotime'
    b' return iso8601.parse_date(timestr)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/iso8601/iso8601.py", line 195, in parse_date'
    b' raise ParseError("Unable to parse date string %r" % datestring)'
    b"iso8601.iso8601.ParseError: Unable to parse date string '2016-11-05T00:00:00UTC+00:00'"
    b''
    b'During handling of the above exception, another exception occurred:'
    b''
    b'Traceback (most recent call last):'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/masakari/tests/unit/objects/test_fields.py", line 81, in test_coerce_good_values'
    b" self.assertEqual(out_val, self.field.coerce('obj', 'attr', in_val))"
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/fields.py", line 195, in coerce'
    b' return self._type.coerce(obj, attr, value)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/fields.py", line 461, in coerce'
    b' value = timeutils.parse_isotime(value)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_utils/timeutils.py", line 67, in parse_isotime'
    b' raise ValueError(six.text_type(e))'
    b"ValueError: Unable to parse date string '2016-11-05T00:00:00UTC+00:00'"
    b''

masakari.tests.unit.objects.test_fields.TestDateTime.test_from_primitive
------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_utils/timeutils.py", line 65, in parse_isotime'
    b' return iso8601.parse_date(timestr)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/iso8601/iso8601.py", line 195, in parse_date'
    b' raise ParseError("Unable to parse date string %r" % datestring)'
    b"iso8601.iso8601.ParseError: Unable to parse date string '2016-11-05T00:00:00UTC+00:00'"
    b''
    b'During handling of the above exception, another exception occurred:'
    b''
    b'Traceback (most recent call last):'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/masakari/tests/unit/objects/test_fields.py", line 100, in test_from_primitive'
    b" 'attr', prim_val))"
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/fields.py", line 212, in from_primitive'
    b' return self._type.from_primitive(obj, attr, value)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/fields.py", line 477, in from_primitive'
    b' return self.coerce(obj, attr, timeutils.parse_isotime(value))'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/oslo_utils/timeutils.py", line 67, in parse_isotime'
    b' raise ValueError(six.text_type(e))'
    b"ValueError: Unable to parse date string '2016-11-05T00:00:00UTC+00:00'"
    b''

masakari.tests.unit.objects.test_fields.TestDateTime.test_to_primitive
----------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/masakari/tests/unit/objects/test_fields.py", line 91, in test_to_primitive'
    b' in_val))'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 411, in assertEqual'
    b' self.assertThat(observed, matcher, message)'
    b' File "/home/devstack/work_masakari/masakari_py35error_sub/.tox/py35/lib/python3.5/site-packages/testtools/testcase.py", line 498, in assertThat'
    b' raise mismatch_error'
    b"testtools.matchers._impl.MismatchError: '2016-11-05T00:00:00UTC+00:00' != '2016-11-05T00:00:00Z'"
    b''

Changed in masakari:
assignee: nobody → takahara.kengo (takahara.kengo)
status: New → In Progress
Revision history for this message
takahara.kengo (takahara.kengo) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to masakari (master)

Reviewed: https://review.openstack.org/551195
Committed: https://git.openstack.org/cgit/openstack/masakari/commit/?id=634d8bc2efef536008632728a27127eb230b1170
Submitter: Zuul
Branch: master

commit 634d8bc2efef536008632728a27127eb230b1170
Author: Kengo Takahara <email address hidden>
Date: Fri Mar 9 16:41:06 2018 +0900

    Fix for difference in tzinfo.tzname value between py27 and py35

    The tzinfo.tzname value differs between py27 and py35.
    For example, 'UTC' for py27, 'UTC+00:00' for py35.
    Therefore, it is necessary to change the way to get the date string.

    Change-Id: Iae5539e0aec0fab0a08640f7f6600a1d91b241e5
    Closes-Bug: #1753644

Changed in masakari:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/masakari 6.0.0.0b1

This issue was fixed in the openstack/masakari 6.0.0.0b1 development milestone.

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.