mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Add exception handling for docker API error to so-docker-prune
This commit is contained in:
@@ -73,8 +73,12 @@ def main(quiet):
|
|||||||
for tag in group:
|
for tag in group:
|
||||||
if not quiet: print(f'Removing image {tag}')
|
if not quiet: print(f'Removing image {tag}')
|
||||||
client.images.remove(tag)
|
client.images.remove(tag)
|
||||||
except InvalidVersion as e:
|
except (docker.errors.APIError, InvalidVersion) as e:
|
||||||
print(f'so-{get_so_image_basename(t_list[0])}: {e.args[0]}', file=sys.stderr)
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
|
exit(1)
|
||||||
|
except Exception as e:
|
||||||
|
print('Unhandled exception occurred:')
|
||||||
|
print(f'so-{get_so_image_basename(t_list[0])}: {e}', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if no_prunable and not quiet:
|
if no_prunable and not quiet:
|
||||||
|
|||||||
Reference in New Issue
Block a user