Bug 1491816

Summary: python-manilaclient Will Fail on Share List without "search_opts" Parameter For API Versions <= 2.34
Product: Red Hat OpenStack Reporter: Dustin Schoenbrun <dschoenb>
Component: python-manilaclientAssignee: Tom Barron <tbarron>
Status: CLOSED ERRATA QA Contact: Dustin Schoenbrun <dschoenb>
Severity: high Docs Contact:
Priority: high    
Version: 12.0 (Pike)CC: apevec, lhh, tvignaud
Target Milestone: rcKeywords: Triaged
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-manilaclient-1.17.2-1.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 22:08:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Rally Run Log none

Description Dustin Schoenbrun 2017-09-14 18:42:16 UTC
Description of problem:
There was an issue discovered upstream while running Rally tests that showed that the list method for API versions <= 2.34 would fail if no search options were specified for the list command. This would cause the Manila Client to attempt to pop from a NoneType object causing a stack trace.

Version-Release number of selected component (if applicable):
python-manilaclient-1.17.1-0.20170814140937.502eb75.el7ost.noarch

How reproducible:
Seems to always be reproducible with upstream Rally tests.

Steps to Reproduce:
1. Deploy OSP-12 and ensure that Manila is installed.
2. Configure and run the Rally tests for Manila. 
3. Observe that the list method fails when no search options are specified as parameters to the list method.

Actual results:
Traceback (most recent call last):
  File "/opt/stack/new/rally/rally/task/runner.py", line 72, in _run_scenario_once
    getattr(scenario_inst, method_name)(**scenario_kwargs)
  File "/opt/stack/new/rally/rally/plugins/openstack/scenarios/manila/shares.py", line 325, in run
    self._list_shares(detailed=detailed)
  File "/opt/stack/new/rally/rally/task/atomic.py", line 86, in func_atomic_actions
    f = func(self, *args, **kwargs)
  File "/opt/stack/new/rally/rally/plugins/openstack/scenarios/manila/utils.py", line 99, in _list_shares
    detailed=detailed, search_opts=search_opts)
  File "/opt/stack/new/python-manilaclient/manilaclient/api_versions.py", line 399, in substitution
    return method.func(obj, *args, **kwargs)
  File "/opt/stack/new/python-manilaclient/manilaclient/v2/shares.py", line 328, in list
    search_opts.pop("export_location", None)
AttributeError: 'NoneType' object has no attribute 'pop'

Expected results:
Rally Tests shall pass successfully.

Additional info:
It looks like this issue was fixed upstream already by https://review.openstack.org/#/c/488848/1. Should be fairly easy to pull this down and put it into our packages.

Comment 1 Tom Barron 2017-09-14 18:58:45 UTC
Fix included in openstack/python-manilaclient 1.17.2 release

Comment 4 Dustin Schoenbrun 2017-11-16 21:35:21 UTC
I was able to run the Rally test task for listing shares against the latest OSP-12 puddle (2017-11-09.2) and all of the tasks were able to pass. I was also able to explicitly try a "manila --os-share-api-version 2.34 list" specifying the 2.34 API version and it was able to complete successfully. Marking this one as verified.

Comment 5 Dustin Schoenbrun 2017-11-16 21:35:56 UTC
Created attachment 1353781 [details]
Rally Run Log

Comment 8 errata-xmlrpc 2017-12-13 22:08:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3462