mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Delete lxd container in state stopped (#2885)
If a lxd container is stopped, do not stop it before deleting it.
This commit is contained in:
parent
05c8630b48
commit
acadc2ac9c
1 changed files with 3 additions and 2 deletions
|
@ -364,7 +364,7 @@ class LXDContainerManagement(object):
|
|||
self.actions.append('restart')
|
||||
|
||||
def _delete_container(self):
|
||||
return self.client.do('DELETE', '/1.0/containers/{0}'.format(self.name))
|
||||
self.client.do('DELETE', '/1.0/containers/{0}'.format(self.name))
|
||||
self.actions.append('delete')
|
||||
|
||||
def _freeze_container(self):
|
||||
|
@ -446,6 +446,7 @@ class LXDContainerManagement(object):
|
|||
if self.old_state != 'absent':
|
||||
if self.old_state == 'frozen':
|
||||
self._unfreeze_container()
|
||||
if self.old_state != 'stopped':
|
||||
self._stop_container()
|
||||
self._delete_container()
|
||||
|
||||
|
|
Loading…
Reference in a new issue