mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
imgadm module should deal with invalid images better
This commit is contained in:
parent
1ea6f4b18b
commit
e4971fcabd
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,7 @@ def _parse_image_meta(image=None, detail=False):
|
|||
|
||||
if image and 'Error' in image:
|
||||
ret = image
|
||||
elif image:
|
||||
elif image and 'manifest' in image:
|
||||
name = image['manifest']['name']
|
||||
version = image['manifest']['version']
|
||||
os = image['manifest']['os']
|
||||
|
@ -164,6 +164,8 @@ def docker_to_uuid(uuid):
|
|||
if _is_docker_uuid(uuid):
|
||||
images = list_installed(verbose=True)
|
||||
for image_uuid in images:
|
||||
if 'name' not in images[image_uuid]:
|
||||
continue
|
||||
if images[image_uuid]['name'] == uuid:
|
||||
return image_uuid
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue