DuplicateResource raised when finding bogus name/id values in proxies
Bug #1486705 reported by
Brian Curtin
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack SDK |
Fix Committed
|
Critical
|
Brian Curtin |
Bug Description
>>> conn.compute.
...
openstack.
^this is not true
description: | updated |
Changed in python-openstacksdk: | |
status: | Confirmed → In Progress |
assignee: | nobody → Brian Curtin (brian.curtin) |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/214822 /git.openstack. org/cgit/ stackforge/ python- openstacksdk/ commit/ ?id=201c86c74bc 187305cf4a7a205 c1794c1890f43e
Committed: https:/
Submitter: Jenkins
Branch: master
commit 201c86c74bc1873 05cf4a7a205c179 4c1890f43e
Author: Brian Curtin <email address hidden>
Date: Wed Aug 19 17:42:41 2015 -0500
Make Resource.find more generically applicable
The previous Resource.find was using query parameters of
id= and name= after directly attempting Resource.get_by_id.
In a few cases, this actually works, such as on Server.find
where it's able to accept the name= query parameter and
properly return a match. However, most other resources don't
work with those query parameters, so unless the find was done
by ID, there was very little chance of finding a match.
This change keeps mostly the same structure but does so without
using query parameters. It keeps the original Resource.get_by_id
to potentially find an immediate match, but if it needs to look
further it does so by making one request for all data and then
looks at both the name and id attributes in a loop to find a matching
resource.
This refactoring ends up fixing several outstanding bugs for
certain resources' find methods not working. It additionally
fixes a bug where searches by name would raise DuplicateResource
both when a single match existed, duplicate matches existed,
and also when no match existed. This was due to the baked in
query parameter logic and assumption that it was working causing
us to handle those responses differently than what they were
really signifying.
Change-Id: I4ae0599334b73b 14a36a6f63bc8b2 6343abb1466
Closes-Bug: 1466174
Closes-Bug: 1384230
Closes-Bug: 1456317
Closes-Bug: 1455768
Closes-Bug: 1486705