compute: Fix --host in server list for new openstacksdk
With `openstacksdk` 3.2.0 the `host` attribute of an Instance got added
to the `Server` class [0]. With that change, listing servers with the `host`
attribute leads to a query-filter for `compute_host` as expected, but
`openstacksdk` will also filter for the `host` attribute locally after
the results are returned. Since `compute_host` being
`OS-EXT-SRV-ATTR:host` is not the same as `host, this means no results
are returned.
Since we want to keep the old behaviour of filtering by `compute_host`
i.e. the service host name, we need to switch to filter for
`compute_host`. This is already supported in older versions of
`openstacksdk`.
[0] 0f311ff3e2
Change-Id: I0cd32c5b7d6d4d21194f3efdcfb9b205dea6a91e
Closes-bug: #2074200
This commit is contained in:
parent
50d1e0916b
commit
ffa683ab4e
@ -2648,7 +2648,7 @@ class ListServer(command.Lister):
|
|||||||
'status': parsed_args.status,
|
'status': parsed_args.status,
|
||||||
'flavor': flavor_id,
|
'flavor': flavor_id,
|
||||||
'image': image_id,
|
'image': image_id,
|
||||||
'host': parsed_args.host,
|
'compute_host': parsed_args.host,
|
||||||
'project_id': project_id,
|
'project_id': project_id,
|
||||||
'all_projects': parsed_args.all_projects,
|
'all_projects': parsed_args.all_projects,
|
||||||
'user_id': user_id,
|
'user_id': user_id,
|
||||||
|
@ -4581,7 +4581,7 @@ class _TestServerList(TestServer):
|
|||||||
'status': None,
|
'status': None,
|
||||||
'flavor': None,
|
'flavor': None,
|
||||||
'image': None,
|
'image': None,
|
||||||
'host': None,
|
'compute_host': None,
|
||||||
'project_id': None,
|
'project_id': None,
|
||||||
'all_projects': False,
|
'all_projects': False,
|
||||||
'user_id': None,
|
'user_id': None,
|
||||||
|
Loading…
Reference in New Issue
Block a user