Skip to content

Commit

Permalink
Do not always init compute_client when doint port list
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jumpojoy authored and Dean Troyer committed May 4, 2017
1 parent 07a4363 commit c69304e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openstackclient/network/v2/port.py
Expand Up @@ -519,7 +519,6 @@ def get_parser(self, prog_name):

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 = (
Expand Down Expand Up @@ -548,6 +547,7 @@ def take_action(self, parsed_args):
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
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/bug-1688194-bb008b65267a1169.yaml
@@ -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>`_]

0 comments on commit c69304e

Please sign in to comment.