From dd8b7d69cc1639dee78561fcd5eb0bc2a0de70c0 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Fri, 15 Jun 2018 01:37:23 -0400 Subject: [PATCH] Add task to gracefully terminate domain class instances --- pvc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pvc.py b/pvc.py index f1a5826f..e0ba4343 100755 --- a/pvc.py +++ b/pvc.py @@ -767,6 +767,9 @@ def undefine_vm(dom_name, dom_uuid): click.echo('Waiting for cluster to update.') time.sleep(3) + # Gracefully terminate the class instances + transaction.set_data('/domains/{}/state'.format(dom_uuid), 'delete'.encode('ascii')) + time.sleep(2) # Delete the configurations click.echo('Undefining VM "{}".'.format(dom_uuid)) transaction = zk.transaction()