yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #54687
[Bug 1608258] Re: test_neutronv2 unit tests fail with python-neutronclient 5.0.0
Reviewed: https://review.openstack.org/349297
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a280d2e88c7a732630a5ae00c2c452c6db34cc8b
Submitter: Jenkins
Branch: master
commit a280d2e88c7a732630a5ae00c2c452c6db34cc8b
Author: Matt Riedemann <mriedem@xxxxxxxxxx>
Date: Sun Jul 31 18:34:57 2016 -0400
Straddle python-neutronclient 5.0 for testing
python-neutronclient 5.0 has deprecated the usage of
tenant_id/tenant_name in place of project_id/project_name
for keystone v3 usage. It does this using debtcollector
decorators on the methods with those kwargs. This is fine
at runtime but doesn't work with mox since mox stubs the
methods off the Client class, but doesn't pick up and stub
any decorators on those methods. So when our unit tests
pass tenant_id kwargs they fail on the moxed_client.
To make the tests work for both neutronclient>5 and <5 we
simply pass the project_id as an arg rather than kwarg
to the show_quota method.
Change-Id: I86bbac3e24bef27396297dfc79eb24c61dbcb6ac
Closes-Bug: #1608258
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1608258
Title:
test_neutronv2 unit tests fail with python-neutronclient 5.0.0
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Seen in a g-r change here:
https://review.openstack.org/#/c/347652/
http://logs.openstack.org/52/347652/5/check/gate-cross-nova-python27
-db-ubuntu-xenial/97c6a0d/console.html#_2016-07-30_17_59_01_389311
2016-07-30 17:59:01.388984 | Captured traceback:
2016-07-30 17:59:01.389033 | ~~~~~~~~~~~~~~~~~~~
2016-07-30 17:59:01.389058 | Traceback (most recent call last):
2016-07-30 17:59:01.389095 | File "nova/tests/unit/network/test_neutronv2.py", line 1678, in test_validate_networks
2016-07-30 17:59:01.389120 | tenant_id=uuids.my_tenant).AndReturn(
2016-07-30 17:59:01.389175 | File "/home/jenkins/workspace/gate-cross-nova-python27-db-ubuntu-xenial/.tox/py27/local/lib/python2.7/site-packages/mox3/mox.py", line 1109, in __call__
2016-07-30 17:59:01.389200 | self._checker.Check(params, named_params)
2016-07-30 17:59:01.389253 | File "/home/jenkins/workspace/gate-cross-nova-python27-db-ubuntu-xenial/.tox/py27/local/lib/python2.7/site-packages/mox3/mox.py", line 1031, in Check
2016-07-30 17:59:01.389280 | % (' '.join(sorted(still_needed))))
2016-07-30 17:59:01.389311 | AttributeError: No values given for arguments: project_id
It's because of this change: https://review.openstack.org/#/c/320090/
And these unit tests are creating a mox'ed mock of the neutronclient
Client class, which doesn't get that these methods are decorated with
a rename from debtcollector:
http://git.openstack.org/cgit/openstack/debtcollector/tree/debtcollector/renames.py#n25
We currently require neutronclient>=4.2 which doesn't have these
kwargs, so I can't start passing project_name/project_id until
neutronclient>=5.0 in g-r, and I can't pass tenant_id/name until that
point.
We might have to change the tests to use mock instead of mox which is
less strict.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1608258/+subscriptions
References