mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
avoid breaking if AutoRemove is not found
This commit is contained in:
parent
97779c965d
commit
a9f26f2ab8
1 changed files with 8 additions and 1 deletions
|
@ -3048,7 +3048,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)
|
||||
pre = ps_(all=True)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue