[Bug 1948507] Re: TypeError when computing QOS feature name
OpenStack Infra
1948507 at bugs.launchpad.net
Fri May 27 16:51:08 UTC 2022
Reviewed: https://review.opendev.org/c/openstack/cinder/+/815560
Committed: https://opendev.org/openstack/cinder/commit/d83a2289d582ad137017f9589c2e42e8d1543c13
Submitter: "Zuul (22348)"
Branch: master
commit d83a2289d582ad137017f9589c2e42e8d1543c13
Author: Luciano Lo Giudice <luciano.logiudice at canonical.com>
Date: Tue Oct 26 19:08:07 2021 -0300
Fix QOS computation
It's possible for a volume's node name to be `None` (because an
API is not present, or the user doesn't have privileges, for example).
For these cases, computing the QOS name can lead to a TypeError, since
it needs to concatenate a prefix to the node name. This patchset fixes
this problem by returning an empty string for the QOS if the node name
is indeed None.
Closes-Bug: #1948507
Change-Id: I16d7bf9fb023f3bc7be0fc8e3e08421b2754d5a5
** Changed in: cinder
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to cinder in Ubuntu.
https://bugs.launchpad.net/bugs/1948507
Title:
TypeError when computing QOS feature name
Status in Cinder:
Fix Released
Status in Ubuntu Cloud Archive:
Fix Released
Status in Ubuntu Cloud Archive wallaby series:
Fix Released
Status in Ubuntu Cloud Archive xena series:
Fix Released
Status in Ubuntu Cloud Archive yoga series:
Fix Released
Status in cinder package in Ubuntu:
Fix Released
Status in cinder source package in Impish:
Fix Committed
Status in cinder source package in Jammy:
Fix Released
Bug description:
=========== Bug description =============
The utility function 'qos_min_feature_name' computes the QOS by
concatenating a prefix to a node name. However, under some
circumstances, it's possible that the node name is `None`, thus
raising a TypeError. This can happen for example, if the
'storage.aggregate' feature is not present (or the user doesn't have
privileges for it), which leads to an always-None node_name (see the
method '_get_ssc_aggregate_info' in
volume/drivers/netapp/utils/capabilities:270)
An easy fix is to check for `None`, and if so, return an empty string.
=========== SRU details for Ubuntu =============
[Impact]
See above.
[Test Case]
charm-cinder-netapp gate fails (https://review.opendev.org/c/openstack/charm-cinder-netapp/+/815130) with the following when unpatched:
2021-11-22 21:17:10.298776 | focal-medium | 2021-11-22 21:17:10 [INFO] test_create_volume (zaza.openstack.charm_tests.cinder_netapp.tests.CinderNetAppTest)
2021-11-22 21:17:10.298864 | focal-medium | 2021-11-22 21:17:10 [INFO] Test creating volumes with basic configuration.
2021-11-22 21:17:10.298940 | focal-medium | 2021-11-22 21:17:10 [INFO] ...
2021-11-22 21:17:34.664694 | focal-medium | 2021-11-22 21:17:34 [INFO] Volume status wait: resource 26a180f3-07d3-4297-99ff-6f7045b8b7d8 in available state, waiting for available
2021-11-22 21:17:36.016716 | focal-medium | 2021-11-22 21:17:36 [INFO] ERROR
2021-11-22 21:17:36.016827 | focal-medium | 2021-11-22 21:17:36 [INFO] ======================================================================
2021-11-22 21:17:36.016905 | focal-medium | 2021-11-22 21:17:36 [INFO] ERROR: test_create_volume (zaza.openstack.charm_tests.cinder_netapp.tests.CinderNetAppTest)
2021-11-22 21:17:36.016915 | focal-medium | 2021-11-22 21:17:36 [INFO] Test creating volumes with basic configuration.
2021-11-22 21:17:36.016922 | focal-medium | 2021-11-22 21:17:36 [INFO] ----------------------------------------------------------------------
2021-11-22 21:17:36.016930 | focal-medium | 2021-11-22 21:17:36 [INFO] Traceback (most recent call last):
2021-11-22 21:17:36.016938 | focal-medium | 2021-11-22 21:17:36 [INFO] File "/home/ubuntu/src/review.opendev.org/openstack/charm-cinder-netapp/build/builds/cinder-netapp/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/cinder_netapp/tests.py", line 93, in test_create_volume
2021-11-22 21:17:36.017021 | focal-medium | 2021-11-22 21:17:36 [INFO] host = getattr(test_vol, 'os-vol-host-attr:host').split('#')[0]
2021-11-22 21:17:36.017030 | focal-medium | 2021-11-22 21:17:36 [INFO] AttributeError: 'NoneType' object has no attribute 'split'
2021-11-22 21:17:36.017037 | focal-medium | 2021-11-22 21:17:36 [INFO] ----------------------------------------------------------------------
[Regression Potential]
It's possible that a user may expect the QOS to be non-empty and make
some assertions based on that assumption. In addition, a user may
expect an exception of type `TypeError` to be raised when the node name
is None.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1948507/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list