From 22df4ea07f46023ae07e75796a267b7a9d43cf58 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 16 Jan 2018 11:19:05 +0000 Subject: Improve "Libvirt.virsh_destroy_vm" function Read the command exit code and log a warning in case the VM destroy process went wrong. JIRA: YARDSTICK-943 Change-Id: I2750b8d4a8f67af081c1988510cf5aca848a2cf1 Signed-off-by: Rodolfo Alonso Hernandez --- yardstick/benchmark/contexts/standalone/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'yardstick/benchmark/contexts/standalone/model.py') diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py index ffa37fd37..f18d090d8 100644 --- a/yardstick/benchmark/contexts/standalone/model.py +++ b/yardstick/benchmark/contexts/standalone/model.py @@ -113,7 +113,10 @@ class Libvirt(object): @staticmethod def virsh_destroy_vm(vm_name, connection): - connection.execute("virsh destroy %s" % vm_name) + LOG.info('VM destroy, VM name: %s', vm_name) + status, _, error = connection.execute('virsh destroy %s' % vm_name) + if status: + LOG.warning('Error destroying VM %s. Error: %s', vm_name, error) @staticmethod def _add_interface_address(interface, pci_address): -- cgit 1.2.3-korg