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
  • Loading branch information
jeroen92 committed Aug 26, 2018
1 parent 18d605e commit 29a44ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion salt/modules/virt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3292,7 +3292,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 29a44ac

Please sign in to comment.