volume list: don't fail when there's no compute service
There may be deployments that only have a volume service but no compute service, possibly as an intermediate step during the initial setup. Don't fail the "volume list" command when no compute client can be initiated. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: Idef77bdc8753a456a4c431b0385318dff6581a65
This commit is contained in:
parent
d876b41958
commit
077c9a77a2
@ -361,7 +361,6 @@ class ListVolume(command.Lister):
|
|||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
|
|
||||||
volume_client = self.app.client_manager.volume
|
volume_client = self.app.client_manager.volume
|
||||||
compute_client = self.app.client_manager.compute
|
|
||||||
identity_client = self.app.client_manager.identity
|
identity_client = self.app.client_manager.identity
|
||||||
|
|
||||||
if parsed_args.long:
|
if parsed_args.long:
|
||||||
@ -393,6 +392,7 @@ class ListVolume(command.Lister):
|
|||||||
# Cache the server list
|
# Cache the server list
|
||||||
server_cache = {}
|
server_cache = {}
|
||||||
try:
|
try:
|
||||||
|
compute_client = self.app.client_manager.compute
|
||||||
for s in compute_client.servers.list():
|
for s in compute_client.servers.list():
|
||||||
server_cache[s.id] = s
|
server_cache[s.id] = s
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user