Skip to content

Commit 7596872

Browse files
committed
Add support for outdated libvirt version from trusty-updates
1 parent 94b0ebe commit 7596872

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

cloudify_libvirt/domain_tasks.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,16 @@ def delete(**kwargs):
277277
'Can not destroy guest domain.'
278278
)
279279

280-
if dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) < 0:
281-
raise cfy_exc.NonRecoverableError(
282-
'Can not undefine guest domain.'
283-
)
280+
try:
281+
if dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) < 0:
282+
raise cfy_exc.NonRecoverableError(
283+
'Can not undefine guest domain with NVRAM.'
284+
)
285+
except Exception as e:
286+
ctx.logger.info("Non critical error: {}".format(str(e)))
287+
if dom.undefine() < 0:
288+
raise cfy_exc.NonRecoverableError(
289+
'Can not undefine guest domain.'
290+
)
284291
finally:
285292
conn.close()

0 commit comments

Comments
 (0)