Skip to content

Commit

Permalink
Try/except undefineFlags() as this operation is not supported on bhyve
Browse files Browse the repository at this point in the history
(cherry picked from commit 29a44ac)
  • Loading branch information
jeroen92 authored and dincamihai committed Jun 14, 2019
1 parent b0b5a78 commit e0bded8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion salt/modules/virt.py
Expand Up @@ -3189,7 +3189,10 @@ def purge(vm_, dirs=False, removables=None, **kwargs):
shutil.rmtree(dir_)
if getattr(libvirt, 'VIR_DOMAIN_UNDEFINE_NVRAM', False):
# This one is only in 1.2.8+
dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM)
try:
dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM)
except Exception:
dom.undefine()
else:
dom.undefine()
conn.close()
Expand Down

0 comments on commit e0bded8

Please sign in to comment.