summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
authorSurya Seetharaman <suryaseetharaman.9@gmail.com>2019-01-28 19:30:00 +0100
committerSurya Seetharaman <suryaseetharaman.9@gmail.com>2019-03-06 08:35:25 +0000
commit239b103849b96213dc9cb317006346ce311228e4 (patch)
tree9e6fb30ff0c96d5c86306594ffb83fdd19f7d46f /openstackclient/compute
parentdcff1012fd979f25028052147883bd709b825ea1 (diff)
downloadpython-openstackclient-239b103849b96213dc9cb317006346ce311228e4.tar.gz
API microversion 2.69: Handles Down Cells
This patch explicitly points out the change needed while forming the detailed lists for servers. In those cases where the server response for ``openstack server list`` has the flavor and image keys missing for the instances in the down cell, the servers will be skipped from being processed. Depends-On: https://review.openstack.org/591657/ Related to blueprint handling-down-cell Change-Id: Ibcfe9febdc45db1cb86c6e88f65976feceb01c02
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/v2/server.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index b608ecbd..36a67433 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -1314,6 +1314,14 @@ class ListServer(command.Lister):
# Populate image_name, image_id, flavor_name and flavor_id attributes
# of server objects so that we can display those columns.
for s in data:
+ if compute_client.api_version >= api_versions.APIVersion('2.69'):
+ # NOTE(tssurya): From 2.69, we will have the keys 'flavor'
+ # and 'image' missing in the server response during
+ # infrastructure failure situations.
+ # For those servers with partial constructs we just skip the
+ # processing of the image and flavor informations.
+ if not hasattr(s, 'image') or not hasattr(s, 'flavor'):
+ continue
if 'id' in s.image:
image = images.get(s.image['id'])
if image: