Set destroy=True in opts when destroying cloud instance

This allows for LXC cloud implementation to properly return instance(s)
from `list_nodes` to check if instance exists and can be destroyed.
`list_nodes` uses tricky filtering to avoid showing some running LXC
containers when in creation mode. However sometimes it filters too much
hence the need to pass destroy=True via opts.

Additionally LXC cloud implementation will refuse to destroy container
if destroy=True is not present in opts.

This change is safe for all the rest of cloud implementations because
they don't use __opts__['destroy'].
This commit is contained in:
cellscape 2015-05-08 13:26:20 +06:00
parent 9e1311a7cd
commit c4047d2a71

View file

@ -355,7 +355,7 @@ class CloudClient(object):
'''
Destroy the named VMs
'''
mapper = salt.cloud.Map(self._opts_defaults())
mapper = salt.cloud.Map(self._opts_defaults(destroy=True))
if isinstance(names, str):
names = names.split(',')
return salt.utils.cloud.simple_types_filter(