Manila unit tests KeyError: 'service' and 'reason'

Bug #1966473 reported by Alex Deiter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
Alex Deiter

Bug Description

Description: Manila unit tests raise a lot of KeyError exceptions

Steps to reproduce:
- Deploy a DevStack environment with Manila service enabled (master branch)
- Run Manila unit tests (tox -e py3)

Expected results:
- Success
- No exception messages

Actual result:
Manila unit tests raise a lot of KeyError exceptions, for example:
$ tox -e py3
py3 run-test: commands[0] | stestr run
Exception in string format operation.
Traceback (most recent call last):
  File "/opt/stack/manila/manila/exception.py", line 88, in __init__
    message = self.message % kwargs
KeyError: 'service'
code: 400
Exception in string format operation.
Traceback (most recent call last):
  File "/opt/stack/manila/manila/exception.py", line 88, in __init__
    message = self.message % kwargs
KeyError: 'reason'
code: 400
...

Total errors:
$ tox -e py3 -- 2>&1 | grep KeyError | sort | uniq -c
      2 KeyError: 'err'
      2 KeyError: 'msg'
      8 KeyError: 'reason'
      1 KeyError: 'result'
      2 KeyError: 'service'
      2 KeyError: 'share_server_id'
      1 KeyError: 'snapshot_name'

Root cause: missed keyword arguments for Manila exceptions in some unit tests.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/835239

Changed in manila:
status: New → In Progress
Alex Deiter (deiter)
Changed in manila:
assignee: nobody → Alex Deiter (deiter)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/835239
Committed: https://opendev.org/openstack/manila/commit/6669330d926d01691ea0788e72a361b6e75ddefb
Submitter: "Zuul (22348)"
Branch: master

commit 6669330d926d01691ea0788e72a361b6e75ddefb
Author: Alex Deiter <email address hidden>
Date: Fri Mar 25 12:01:55 2022 +0000

    Fix KeyError exceptions in Manila unit tests

    Added missed 'service' and 'reason' keywords for Manila exceptions unit tests.

    Closes-bug: #1966473
    Change-Id: I70533951f46cddd171b1979ed57a59a5448a4557

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 15.0.0.0rc1

This issue was fixed in the openstack/manila 15.0.0.0rc1 release candidate.

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.