generate_config_file_samples.sh fails with invalid literal for int() with base 10

Bug #1961906 reported by Abdallah Yasin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Low
Unassigned

Bug Description

Following [1], pyroute2 now include [2], which expects the kernel name to have a specific format, if this format is not followed the package would fail.

Our CIs runs on none inbox kernels which do not follow the inbox naming convention. the neutron ./tools/generate_config_file_samples.sh script now fail on our CIs with the following error:

exec ./tools/generate_config_file_samples.sh
07:01:54 Traceback (most recent call last):
07:01:54 File "/usr/local/bin/oslo-config-generator", line 8, in <module>
07:01:54 sys.exit(main())
07:01:54 File "/usr/local/lib/python3.8/site-packages/oslo_config/generator.py", line 836, in main
07:01:54 generate(conf)
07:01:54 File "/usr/local/lib/python3.8/site-packages/oslo_config/generator.py", line 797, in generate
07:01:54 groups = _get_groups(_list_opts(conf.namespace))
07:01:54 File "/usr/local/lib/python3.8/site-packages/oslo_config/generator.py", line 524, in _list_opts
07:01:54 loaders = _get_raw_opts_loaders(namespaces)
07:01:54 File "/usr/local/lib/python3.8/site-packages/oslo_config/generator.py", line 464, in _get_raw_opts_loaders
07:01:54 mgr = stevedore.named.NamedExtensionManager(
07:01:54 File "/usr/local/lib/python3.8/site-packages/stevedore/named.py", line 78, in __init__
07:01:54 extensions = self._load_plugins(invoke_on_load,
07:01:54 File "/usr/local/lib/python3.8/site-packages/stevedore/extension.py", line 233, in _load_plugins
07:01:54 self._on_load_failure_callback(self, ep, err)
07:01:54 File "/usr/local/lib/python3.8/site-packages/stevedore/extension.py", line 221, in _load_plugins
07:01:54 ext = self._load_one_plugin(ep,
07:01:54 File "/usr/local/lib/python3.8/site-packages/stevedore/named.py", line 156, in _load_one_plugin
07:01:54 return super(NamedExtensionManager, self)._load_one_plugin(
07:01:54 File "/usr/local/lib/python3.8/site-packages/stevedore/extension.py", line 255, in _load_one_plugin
07:01:54 plugin = ep.load()
07:01:54 File "/usr/lib64/python3.8/importlib/metadata.py", line 77, in load
07:01:54 module = import_module(match.group('module'))
07:01:54 File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
07:01:54 return _bootstrap._gcd_import(name[level:], package, level)
07:01:54 File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
07:01:54 File "<frozen importlib._bootstrap>", line 991, in _find_and_load
07:01:54 File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
07:01:54 File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
07:01:54 File "<frozen importlib._bootstrap_external>", line 848, in exec_module
07:01:54 File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
07:01:54 File "/opt/stack/neutron/neutron/opts.py", line 28, in <module>
07:01:54 import neutron.conf.agent.l3.ha
07:01:54 File "/opt/stack/neutron/neutron/conf/agent/l3/ha.py", line 20, in <module>
07:01:54 from neutron.agent.linux import keepalived
07:01:54 File "/opt/stack/neutron/neutron/agent/linux/keepalived.py", line 29, in <module>
07:01:54 from neutron.agent.linux import external_process
07:01:54 File "/opt/stack/neutron/neutron/agent/linux/external_process.py", line 26, in <module>
07:01:54 from neutron.agent.linux import ip_lib
07:01:54 File "/opt/stack/neutron/neutron/agent/linux/ip_lib.py", line 29, in <module>
07:01:54 from pyroute2.netlink import exceptions \
07:01:54 File "/usr/local/lib/python3.8/site-packages/pyroute2/__init__.py", line 14, in <module>
07:01:54 from pr2modules.config.version import __version__
07:01:54 File "/usr/local/lib/python3.8/site-packages/pr2modules/config/__init__.py", line 25, in <module>
07:01:54 kernel = [int(x) for x in uname[2].split('-')[0].split('.')]
07:01:54 File "/usr/local/lib/python3.8/site-packages/pr2modules/config/__init__.py", line 25, in <listcomp>
07:01:54 kernel = [int(x) for x in uname[2].split('-')[0].split('.')]
07:01:54 ValueError: invalid literal for int() with base 10: '0_for_upstream_perf_2022_01_10_23_12'

Can you guys help us to fix the issue?

Thanks.

[1] https://github.com/openstack/requirements/commit/812b39ddef60d76c037311144465714929a92041
[2] https://github.com/svinota/pyroute2/commit/12a1aa8530540ad644e3098b08859b9e31321500

Abdallah Yasin (abdysn)
description: updated
Revision history for this message
Lajos Katona (lajos-katona) wrote :

Thanks for the bug report, good to hear that Openstack is tried on new environments.

As you wrote the relevant code is in pyroute2 which tries to parse kernel version, so from Neutron perspective we can't solve it.
I would write a new issue for pyroute2: https://github.com/svinota/pyroute2/issues

Changed in neutron:
importance: Undecided → Low
status: New → Invalid
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.