Skip to content

Commit c69304e

Browse files
jumpojoyDean Troyer
authored andcommitted
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
1 parent 07a4363 commit c69304e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

openstackclient/network/v2/port.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ def get_parser(self, prog_name):
519519

520520
def take_action(self, parsed_args):
521521
network_client = self.app.client_manager.network
522-
compute_client = self.app.client_manager.compute
523522
identity_client = self.app.client_manager.identity
524523

525524
columns = (
@@ -548,6 +547,7 @@ def take_action(self, parsed_args):
548547
ignore_missing=False)
549548
filters['device_id'] = _router.id
550549
if parsed_args.server:
550+
compute_client = self.app.client_manager.compute
551551
server = utils.find_resource(compute_client.servers,
552552
parsed_args.server)
553553
filters['device_id'] = server.id
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fix issue in ``port list`` command when no Compute endpoint is in the
5+
Service Catalog.
6+
[Bug `1688194 <https://bugs.launchpad.net/bugs/1688194>`_]

0 commit comments

Comments
 (0)