diff options
| author | melanie witt <melwittt@gmail.com> | 2019-06-28 18:17:10 +0000 |
|---|---|---|
| committer | Matt Riedemann <mriedem.os@gmail.com> | 2019-07-22 13:23:51 +0000 |
| commit | 83359fbe4fd7e5850abd45a467bf197c284519b1 (patch) | |
| tree | 327d18e6ba1590c1c4b59185d36f5db3815357e3 /openstackclient/api/utils.py | |
| parent | fd3a94d16be8e7806ff4f3aa7417d8a0d36375fb (diff) | |
| download | python-openstackclient-83359fbe4fd7e5850abd45a467bf197c284519b1.tar.gz | |
Fix BFV server list handling with --name-lookup-one-by-one
When the --name-lookup-one-by-one option passed to the 'server list'
command, the image and flavor names will be looked up for each
server being listed instead of fetching all image/flavor names.
The current code assumes all servers have an image attribute, but
servers booted from volumes have no image, so the following error is
raised when listing BFV servers with --name-lookup-one-by-one:
AttributeError: ('unicode'|'str') object has no attribute 'get'
The error occurs when the code attempts server.image.get('id').
This fixes the --name-lookup-one-by-one code not to assume an image
for a server. The unit tests for 'server list' have also been
robustified to feature one BFV server to enhance our test coverage.
Story: #2006063
Task: #34777
Change-Id: I312c971346c7ded93f6fcaa515098554b8580295
(cherry picked from commit bfc34e11b3437506508b3e120accc0e212268ac6)
Diffstat (limited to 'openstackclient/api/utils.py')
0 files changed, 0 insertions, 0 deletions
