l3_router.service_providers DriverController's _attrs_to_driver is not py3 compatible

Bug #1923423 reported by Lajos Katona
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Lajos Katona

Bug Description

Currently l3_router.service_providers.DriverController._attrs_to_driver has the following:
...
drivers = self.drivers.values()
# make sure default is tried before the rest if defined
if self.default_provider:
    drivers.insert(0, self.drivers[self.default_provider])

As in python3 dict.values() gives back "dict_values" instead of list, insert will fail with:
"AttributeError: 'dict_values' object has no attribute 'insert'"

tags: added: trivial
Changed in neutron:
assignee: nobody → Lajos Katona (lajos-katona)
Revision history for this message
Lajos Katona (lajos-katona) wrote :
Changed in neutron:
importance: Undecided → Low
Changed in neutron:
status: New → Triaged
Revision history for this message
Vivekanandan Narasimhan (vivekanandan-narasimhan) wrote :
Download full text (13.0 KiB)

As discussed, please find the logs for the issue with router create with default flavor.
Following includes:
1. Router/Flavor creation logs
2. Stack trace seen in neutron logs
3. Proposed fix
4. Working logs after fix

Note: There is still an issue open that ‘openstack router show <routername>’ still shows flavor-Id as ‘None’.
This can be populated with the default flavor ID by neutron or accordingly APIs can be implemented to display the same via flavor Plugin.

Router/Flavor creation logs:
### Config file #########
[service_providers]
service_provider = L3_ROUTER_NAT:Reference_HA_Router:neutron.services.l3_router.service_providers.ha.HaDriver:default
service_provider = L3_ROUTER_NAT:Reference_DVR_Router:neutron.services.l3_router.service_providers.dvr.DvrDriver

### Create flavor and create router with flavor name ####
stack@devstackVM:~$ openstack network flavor profile create --driver neutron.services.l3_router.service_providers.dvr.DvrDriver --enable
+-------------+------------------------------------------------------------+
| Field | Value |
+-------------+------------------------------------------------------------+
| description | |
| driver | neutron.services.l3_router.service_providers.dvr.DvrDriver |
| enabled | True |
| id | 6377366e-e760-4e53-bd46-bd6b82f33f89 |
| meta_info | |
| name | None |
| project_id | None |
+-------------+------------------------------------------------------------+
stack@devstackVM:~$ openstack network flavor create --service-type L3_ROUTER_NAT my_reference_dvr_router
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| description | |
| enabled | True |
| id | 84798f4e-f88e-43f4-9677-d1613588a65e |
| name | my_reference_dvr_router |
| project_id | |
| service_profile_ids | [] |
| service_type | L3_ROUTER_NAT |
+---------------------+--------------------------------------+
stack@devstackVM:~$ openstack network flavor add profile my_reference_dvr_router 6377366e-e760-4e53-bd46-bd6b82f33f89
stack@devstackVM:~$ openstack router list

stack@devstackVM:~$ neutron router-create router53 --flavor my_reference_dvr_router
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Created a new router:
+-------------------------+--------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------+
| admin_state_up |...

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Thanks for the detailed reproduction.
Vivek: what do you mean by default flavor? If I understand well there is no default flavor, You have to set it explicitly for your router, or am I wrong?

tags: added: ussuri-backport-potential victoria-backport-potential wallaby-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/786967

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/786967
Committed: https://opendev.org/openstack/neutron/commit/3ec596f9ef0b539ea3868960bc3bfa145d4b6e21
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 3ec596f9ef0b539ea3868960bc3bfa145d4b6e21
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61
    (cherry picked from commit e270ac2ee65c02bdb099d11af7f1d2fb62ad0f61)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/785830
Committed: https://opendev.org/openstack/neutron/commit/109faeac7e2e37da3bb7d5014a37ef18ed8cb80a
Submitter: "Zuul (22348)"
Branch: master

commit 109faeac7e2e37da3bb7d5014a37ef18ed8cb80a
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61

Changed in neutron:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/788600

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/788600
Committed: https://opendev.org/openstack/neutron/commit/321162a65337881f0f5bf44dc7c6639cabbe3a02
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 321162a65337881f0f5bf44dc7c6639cabbe3a02
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61
    (cherry picked from commit e270ac2ee65c02bdb099d11af7f1d2fb62ad0f61)
    (cherry picked from commit 3ec596f9ef0b539ea3868960bc3bfa145d4b6e21)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/788773

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/788773
Committed: https://opendev.org/openstack/neutron/commit/f15fb6831a12fc5a7d4256c8a96bfde3c3feb5a8
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit f15fb6831a12fc5a7d4256c8a96bfde3c3feb5a8
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61
    (cherry picked from commit e270ac2ee65c02bdb099d11af7f1d2fb62ad0f61)
    (cherry picked from commit 3ec596f9ef0b539ea3868960bc3bfa145d4b6e21)
    (cherry picked from commit 321162a65337881f0f5bf44dc7c6639cabbe3a02)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/789666

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/789666
Committed: https://opendev.org/openstack/neutron/commit/a89be81928b11caa1ff18095104b7b54bb0af84c
Submitter: "Zuul (22348)"
Branch: stable/train

commit a89be81928b11caa1ff18095104b7b54bb0af84c
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61
    (cherry picked from commit e270ac2ee65c02bdb099d11af7f1d2fb62ad0f61)
    (cherry picked from commit 3ec596f9ef0b539ea3868960bc3bfa145d4b6e21)
    (cherry picked from commit 321162a65337881f0f5bf44dc7c6639cabbe3a02)
    (cherry picked from commit f15fb6831a12fc5a7d4256c8a96bfde3c3feb5a8)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/c/openstack/neutron/+/790258

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 15.3.4

This issue was fixed in the openstack/neutron 15.3.4 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.3.2

This issue was fixed in the openstack/neutron 16.3.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 17.1.2

This issue was fixed in the openstack/neutron 17.1.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/stein)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/790258
Committed: https://opendev.org/openstack/neutron/commit/b383e5977c6fcf7ad98c546c22185f987f8e5adf
Submitter: "Zuul (22348)"
Branch: stable/stein

commit b383e5977c6fcf7ad98c546c22185f987f8e5adf
Author: elajkat <email address hidden>
Date: Mon Apr 12 09:54:59 2021 +0200

    trivial: Make driver_controller's _attrs_to_driver py3 compatible

    In python3 dict.values() doesn't return list but instead dict_values,
    it must be converted to list to "enjoy" list operations like insert.
    Add unit tests to be sure.

    Closes-Bug: #1923423
    Change-Id: Ie270ac2ee65c02bdb099d11af7f1d2fb62ad0f61
    (cherry picked from commit e270ac2ee65c02bdb099d11af7f1d2fb62ad0f61)
    (cherry picked from commit 3ec596f9ef0b539ea3868960bc3bfa145d4b6e21)
    (cherry picked from commit 321162a65337881f0f5bf44dc7c6639cabbe3a02)
    (cherry picked from commit f15fb6831a12fc5a7d4256c8a96bfde3c3feb5a8)
    (cherry picked from commit a89be81928b11caa1ff18095104b7b54bb0af84c)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.1.0

This issue was fixed in the openstack/neutron 18.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron stein-eol

This issue was fixed in the openstack/neutron stein-eol 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.