Skip to content

Commit

Permalink
[lxd_runtime] Fix image metadata
Browse files Browse the repository at this point in the history
Sometimes the update_sources attribute is not available so cannot
build the list

Signed-off-by: Arif Ali <[email protected]>
  • Loading branch information
arif-ali authored and TurboTurtle committed Oct 31, 2023
1 parent 99f1719 commit c47c78a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sos/policies/runtimes/lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def get_images(self):
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):
Expand Down

0 comments on commit c47c78a

Please sign in to comment.