yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #75892
[Bug 1804420] Re: placement unit test placement.tests.unit.cmd.test_manage.TestCommandParsers.test_commands_associated fails on CentOS 7
I've attached a simple script to reproduce this behaviour outside of
placement.
I'm struggling to find where but AFAICT the oslo.config code parsing the
command line args is failing and defaulting to the default help func for
the top level command parser.
# cat /etc/redhat-release
Fedora release 28 (Twenty Eight)
# python --version
Python 2.7.15
# pip freeze | grep oslo.config
oslo.config==6.7.0
# python reproduce.py cmd bar
<bound method Commands.bar of <__main__.Commands object at 0x7f50d187c110>>
# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
# python --version
Python 2.7.5
# pip freeze | grep oslo.config
oslo.config==6.7.0
# python reproduce.py cmd bar
<bound method _CachedArgumentParser.print_help of _CachedArgumentParser(prog='reproduce cmd', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)>
** Attachment added: "reproduce.py"
https://bugs.launchpad.net/nova/+bug/1804420/+attachment/5215276/+files/reproduce.py
** Also affects: oslo.config
Importance: Undecided
Status: New
--
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/1804420
Title:
placement unit test
placement.tests.unit.cmd.test_manage.TestCommandParsers.test_commands_associated
fails on CentOS 7
Status in OpenStack Compute (nova):
New
Status in oslo.config:
New
Bug description:
Test
placement.tests.unit.cmd.test_manage.TestCommandParsers.test_commands_associated
fails to run using tox -epy27 on CentOS 7. However, it works fine on
Fedora 28 (with a different Python 2 version).
I get the following:
placement.tests.unit.cmd.test_manage.TestCommandParsers.test_commands_associated
--------------------------------------------------------------------------------
Captured stdout:
~~~~~~~~~~~~~~~~
usage: run db [-h] {sync,version} ...
optional arguments:
-h, --help show this help message and exit
subcommands:
database commands
{sync,version}
sync Sync the datatabse to the current version.
version Report the current database version.
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "placement/tests/unit/cmd/test_manage.py", line 55, in test_commands_associated
mock_command.assert_called_once_with()
File "/placement/.tox/py27/lib/python2.7/site-packages/mock/mock.py", line 947, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected 'db_version' to be called once. Called 0 times.
This started to fail since https://review.openstack.org/600161 was
merged.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1804420/+subscriptions
References