Browse Source

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
tags/3.11.0^0
Vasyl Saienko 2 years ago
parent
commit
c69304e3d3
2 changed files with 7 additions and 1 deletions
  1. +1
    -1
      openstackclient/network/v2/port.py
  2. +6
    -0
      releasenotes/notes/bug-1688194-bb008b65267a1169.yaml

+ 1
- 1
openstackclient/network/v2/port.py View File

@@ -519,7 +519,6 @@ class ListPort(command.Lister):

def take_action(self, parsed_args):
network_client = self.app.client_manager.network
compute_client = self.app.client_manager.compute
identity_client = self.app.client_manager.identity

columns = (
@@ -548,6 +547,7 @@ class ListPort(command.Lister):
ignore_missing=False)
filters['device_id'] = _router.id
if parsed_args.server:
compute_client = self.app.client_manager.compute
server = utils.find_resource(compute_client.servers,
parsed_args.server)
filters['device_id'] = server.id

+ 6
- 0
releasenotes/notes/bug-1688194-bb008b65267a1169.yaml View 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…
Cancel
Save