From c69304e3d365dc2c67fab298eba0b9097d3819da Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Thu, 4 May 2017 10:48:11 +0300 Subject: [PATCH] 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 --- openstackclient/network/v2/port.py | 2 +- releasenotes/notes/bug-1688194-bb008b65267a1169.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1688194-bb008b65267a1169.yaml diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 3a32916b78..0ed2e44a2d 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -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 diff --git a/releasenotes/notes/bug-1688194-bb008b65267a1169.yaml b/releasenotes/notes/bug-1688194-bb008b65267a1169.yaml new file mode 100644 index 0000000000..f7e6ad4975 --- /dev/null +++ b/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 `_]