mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
avoid breaking if AutoRemove is not found
This commit is contained in:
parent
23d60b9977
commit
2c35f9c912
@ -3808,7 +3808,14 @@ def rm_(name, force=False, volumes=False, **kwargs):
|
||||
'remove this container'.format(name)
|
||||
)
|
||||
if stop_ and not force:
|
||||
auto_remove = inspect_container(name)['HostConfig']['AutoRemove']
|
||||
inspect_results = inspect_container(name)
|
||||
try:
|
||||
auto_remove = inspect_results['HostConfig']['AutoRemove']
|
||||
except KeyError:
|
||||
log.error(
|
||||
'Failed to find AutoRemove in inspect results, Docker API may '
|
||||
'have changed. Full results: %s', inspect_results
|
||||
)
|
||||
stop(name, timeout=timeout)
|
||||
pre = ps_(all=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user