Do not always init compute_client when doint port list
This patch ensures that compute client is initialized only when needed (--server arg is passed) to openstack port list command. Otherwise it leads to failures on installations without Nova. Change-Id: I102683461daa2f7d05dd9d7a3ec72de551c65ca9 Closes-Bug: #1688194
This commit is contained in:
parent
07a4363e99
commit
c69304e3d3
@ -519,7 +519,6 @@ class ListPort(command.Lister):
|
|||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
network_client = self.app.client_manager.network
|
network_client = self.app.client_manager.network
|
||||||
compute_client = self.app.client_manager.compute
|
|
||||||
identity_client = self.app.client_manager.identity
|
identity_client = self.app.client_manager.identity
|
||||||
|
|
||||||
columns = (
|
columns = (
|
||||||
@ -548,6 +547,7 @@ class ListPort(command.Lister):
|
|||||||
ignore_missing=False)
|
ignore_missing=False)
|
||||||
filters['device_id'] = _router.id
|
filters['device_id'] = _router.id
|
||||||
if parsed_args.server:
|
if parsed_args.server:
|
||||||
|
compute_client = self.app.client_manager.compute
|
||||||
server = utils.find_resource(compute_client.servers,
|
server = utils.find_resource(compute_client.servers,
|
||||||
parsed_args.server)
|
parsed_args.server)
|
||||||
filters['device_id'] = server.id
|
filters['device_id'] = server.id
|
||||||
|
6
releasenotes/notes/bug-1688194-bb008b65267a1169.yaml
Normal file
6
releasenotes/notes/bug-1688194-bb008b65267a1169.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fix issue in ``port list`` command when no Compute endpoint is in the
|
||||||
|
Service Catalog.
|
||||||
|
[Bug `1688194 <https://bugs.launchpad.net/bugs/1688194>`_]
|
Loading…
Reference in New Issue
Block a user