aboutsummaryrefslogtreecommitdiffstats
path: root/sos
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2023-10-30 23:22:16 +0000
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2023-10-31 10:43:26 -0700
commitc47c78a8f18875e105b7bd8a17801e4f941f24e7 (patch)
treeefecd6f219d994b93a662eb17bebf37c298ddc50 /sos
parent99f17199c8312ebb43b6236ef000e1a1baabb46e (diff)
downloadsos-c47c78a8f18875e105b7bd8a17801e4f941f24e7.tar.gz
[lxd_runtime] Fix image metadata
Sometimes the update_sources attribute is not available so cannot build the list Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'sos')
-rw-r--r--sos/policies/runtimes/lxd.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sos/policies/runtimes/lxd.py b/sos/policies/runtimes/lxd.py
index 23c17164..715514d6 100644
--- a/sos/policies/runtimes/lxd.py
+++ b/sos/policies/runtimes/lxd.py
@@ -70,9 +70,10 @@ class LxdContainerRuntime(ContainerRuntime):
out_json = json.loads(out["output"])
for ent in out_json:
# takes the form (image_name, image_id)
- images.append((
- ent['update_source']['alias'],
- ent['fingerprint']))
+ if 'update_source' in ent:
+ images.append((
+ ent['update_source']['alias'],
+ ent['fingerprint']))
return images
def get_volumes(self):