neutron cli UT failure

Bug #1706573 reported by YAMAMOTO Takashi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-midonet
Fix Released
Critical
YAMAMOTO Takashi
networking-sfc
Fix Released
Undecided
Bernard Cafarelli
python-neutronclient
Fix Released
High
Akihiro Motoki
tap-as-a-service
Fix Released
Critical
YAMAMOTO Takashi

Bug Description

neutronclient.shell.COMMANDS has been removed in python-neutronclient 6.4.0. [1]

[1] I3950ed8cf50508210c8b3270724e283aea8e1673

while COMMANDS is merely an internal detail of python-neutronclient,
it seems it's widely adopted (read; copy-and-pasted) practice to reference it in UTs.
http://codesearch.openstack.org/?q=test_ext_cmd_loaded&i=nope&files=&repos=

eg. http://logs.openstack.org/03/486903/2/check/gate-tap-as-a-service-python27-ubuntu-xenial/776d5aa/testr_results.html.gz

ft2.4: neutron_taas.tests.unit.taas_client.test_cli20_tapservice.CLITestV20TapServiceJSON.test_ext_cmd_loaded_StringException: Traceback (most recent call last):
  File "neutron_taas/tests/unit/taas_client/test_cli20_tapservice.py", line 51, in test_ext_cmd_loaded
    self.assertDictContainsSubset(extension_cmd, shell.COMMANDS['2.0'])
AttributeError: 'module' object has no attribute 'COMMANDS'

tags: added: gate-failure
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tap-as-a-service (master)

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

description: updated
description: updated
Revision history for this message
YAMAMOTO Takashi (yamamoto) wrote :
Changed in tap-as-a-service:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
status: New → In Progress
Changed in networking-midonet:
assignee: nobody → YAMAMOTO Takashi (yamamoto)
importance: Undecided → Critical
milestone: none → 5.0.0
status: New → In Progress
tags: added: midokura-jira-tracked
Revision history for this message
Akihiro Motoki (amotoki) wrote :

neutronclient 6.4.0 changes the command loading mechanism and neutornclient.shell.COMMANDS dictionary has been dropped.

According to this bug report and information from yamamoto on IRC [1] , it affects neutronclient extensions projects and breaks their UT.

COMMANDS dictionary is not intended to be a public interface, so I am really surprised it is used in their UT, but considering the current situation, it looks like to provide COMMANDS compatibility in the next release of python-neutronclient.

[1] http://eavesdrop.openstack.org/irclogs/%23openstack-neutron/%23openstack-neutron.2017-07-26.log.html#t2017-07-26T11:04:23

Changed in python-neutronclient:
status: New → Confirmed
assignee: nobody → Akihiro Motoki (amotoki)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-midonet (master)

Reviewed: https://review.openstack.org/487375
Committed: https://git.openstack.org/cgit/openstack/networking-midonet/commit/?id=a7ba00f36d4bd4bd6a986f30ab9552b1bc6581fa
Submitter: Jenkins
Branch: master

commit a7ba00f36d4bd4bd6a986f30ab9552b1bc6581fa
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Jul 26 20:38:47 2017 +0900

    Update neutron cli unit tests

    For python-neutronclient 6.4.0.

    Closes-Bug: #1706573
    Change-Id: I72d87d10a566869d97eb8d4f3f2369cffb223f70

Changed in networking-midonet:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

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

Changed in python-neutronclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/487805
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=bbdea85ba4681ad1a7fdee4ec4f544e75f0d1202
Submitter: Jenkins
Branch: master

commit bbdea85ba4681ad1a7fdee4ec4f544e75f0d1202
Author: Akihiro Motoki <email address hidden>
Date: Thu Jul 27 10:32:23 2017 +0000

    Populate shell.COMMANDS dict not to break CLI extension UT

    shell.COMMANDS is not intended to be public.
    However, 8 projects using neutron CLI extenions access this variable
    in their UT. I am honestly surprised on this, but it is the real.
    Neutron CLI is now deprecated, so it is better not to break them.

    This commit populates shell.COMMANDS dict based on registered commands.

    The following is my testting results with 'neutron net-list'.
    I ran this 10 times and the average user time is as follows:
     before 1.096 sec
     after 1.112 sec

    More dynamic loading can be explored but I think
    this overhead can be acceptable.

    Closes-Bug: #1706573
    Change-Id: Idcbc64e6f709a666829e0c2985a03aa4517ccf77

Changed in python-neutronclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-midonet 5.0.0.0b3

This issue was fixed in the openstack/networking-midonet 5.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-neutronclient 6.5.0

This issue was fixed in the openstack/python-neutronclient 6.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-sfc (master)

Reviewed: https://review.openstack.org/488344
Committed: https://git.openstack.org/cgit/openstack/networking-sfc/commit/?id=62c3542bf33fc4c3772e402ab77416903b11050d
Submitter: Jenkins
Branch: master

commit 62c3542bf33fc4c3772e402ab77416903b11050d
Author: Bernard Cafarelli <email address hidden>
Date: Fri Jul 28 11:19:48 2017 +0200

    Fix cli unit tests

    python-neutronclient 6.4.0 removed neutronclient.shell.COMMAND

    Change-Id: I89232987af9e3bf84fefa591ae7260abf9156762
    Closes-Bug: #1706573

Changed in networking-sfc:
status: New → Fix Released
Changed in networking-sfc:
assignee: nobody → Bernard Cafarelli (bcafarel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-sfc 5.0.0.0rc1

This issue was fixed in the openstack/networking-sfc 5.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tap-as-a-service (master)

Reviewed: https://review.openstack.org/487368
Committed: https://git.openstack.org/cgit/openstack/tap-as-a-service/commit/?id=93868fc6b50c782c8026b2c8907346e25470727f
Submitter: Zuul
Branch: master

commit 93868fc6b50c782c8026b2c8907346e25470727f
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Jul 26 19:58:07 2017 +0900

    Update neutron cli unit tests

    After the recent python-neutronclient change. [1]

    [1] I3950ed8cf50508210c8b3270724e283aea8e1673

    Closed-Bug: #1706573
    Change-Id: I8bf78427812895000a85466fb15f0ca65331dff6

Changed in tap-as-a-service:
importance: Undecided → Critical
status: In Progress → Fix Released
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.