In python3.5 environment, synchronization router exception

Bug #1666113 reported by Guoshuai Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
Fix Released
Undecided
Guoshuai Li

Bug Description

In python3.5, deepcopy dict_keys objects exception when get_floatingips with filters is {'router_id': dict_keys([])}

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/opt/stack/neutron/neutron/tests/base.py", line 116, in func
        return f(self, *args, **kwargs)
      File "/opt/stack/networking-ovn/networking_ovn/tests/functional/test_ovn_db_sync.py", line 910, in test_ovn_nb_sync_repair_delete_ovn_nb_db
        restart_ovsdb_processes=True)
      File "/opt/stack/networking-ovn/networking_ovn/tests/functional/test_ovn_db_sync.py", line 900, in _test_ovn_nb_sync_helper
        self._sync_resources(mode)
      File "/opt/stack/networking-ovn/networking_ovn/tests/functional/test_ovn_db_sync.py", line 880, in _sync_resources
        nb_synchronizer.sync_routers_and_rports(ctx)
      File "/opt/stack/networking-ovn/networking_ovn/ovn_db_sync.py", line 346, in sync_routers_and_rports
        ctx, {'router_id': db_routers.keys()})
      File "/opt/stack/neutron/neutron/db/api.py", line 166, in wrapped
        return method(*args, **kwargs)
      File "/opt/stack/neutron/neutron/db/api.py", line 95, in wrapped
        setattr(e, '_RETRY_EXCEEDED', True)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
        self.force_reraise()
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/six.py", line 686, in reraise
        raise value
      File "/opt/stack/neutron/neutron/db/api.py", line 91, in wrapped
        return f(*args, **kwargs)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_db/api.py", line 151, in wrapper
        ectxt.value = e.inner_exc
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
        self.force_reraise()
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/six.py", line 686, in reraise
        raise value
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_db/api.py", line 139, in wrapper
        return f(*args, **kwargs)
      File "/opt/stack/neutron/neutron/db/api.py", line 131, in wrapped
        traceback.format_exc())
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 220, in __exit__
        self.force_reraise()
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/site-packages/six.py", line 686, in reraise
        raise value
      File "/opt/stack/neutron/neutron/db/api.py", line 124, in wrapped
        dup_args = [_copy_if_lds(a) for a in args]
      File "/opt/stack/neutron/neutron/db/api.py", line 124, in <listcomp>
        dup_args = [_copy_if_lds(a) for a in args]
      File "/opt/stack/neutron/neutron/db/api.py", line 101, in _copy_if_lds
        return copy.deepcopy(item) if isinstance(item, (list, dict, set)) else item
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/copy.py", line 155, in deepcopy
        y = copier(x, memo)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/copy.py", line 243, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/opt/stack/networking-ovn/.tox/dsvm-functional-py35/lib/python3.5/copy.py", line 174, in deepcopy
        rv = reductor(4)
    TypeError: can't pickle dict_keys objects

Changed in networking-ovn:
assignee: nobody → Guoshuai Li (liguoshuai1990)
Changed in networking-ovn:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (master)

Reviewed: https://review.openstack.org/435861
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=45076c6b15ba8f34c3bc3da94589ba21b355ffd1
Submitter: Jenkins
Branch: master

commit 45076c6b15ba8f34c3bc3da94589ba21b355ffd1
Author: Guoshuai Li <email address hidden>
Date: Mon Feb 20 14:30:45 2017 +0800

    fix deepcopy dict_keys exception in python3.5

    change dict_keys object to list

    Closes-Bug: #1666113

    Change-Id: I34a51bfd5712173196f8d5c59bbae7bd8abb3bd0

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

This issue was fixed in the openstack/networking-ovn 3.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.