mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Don't fail if the vm is not present in virt module
This commit is contained in:
parent
bba75970ac
commit
6e289c8ee1
@ -275,8 +275,11 @@ def destroy(vm_):
|
||||
CLI Example:
|
||||
salt '*' virt.destroy <vm name>
|
||||
'''
|
||||
dom = _get_dom(vm_)
|
||||
dom.destroy()
|
||||
try:
|
||||
dom = _get_dom(vm_)
|
||||
dom.destroy()
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
|
||||
def undefine(vm_):
|
||||
@ -287,8 +290,11 @@ def undefine(vm_):
|
||||
CLI Example:
|
||||
salt '*' virt.undefine <vm name>
|
||||
'''
|
||||
dom = _get_dom(vm_)
|
||||
dom.undefine()
|
||||
try:
|
||||
dom = _get_dom(vm_)
|
||||
dom.undefine()
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
|
||||
def purge(vm_, dirs=False):
|
||||
|
Loading…
Reference in New Issue
Block a user