From 31f3383ae4953019267c67e4fbd2214b03bc8da8 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Tue, 7 Aug 2012 23:19:04 +0000 Subject: xenapi: wait for agent resetnetwork response Unlike every other agent command, the resetnetwork command would not wait for a response. All failures were silently ignored. Change this to at least log a message if an error occurs. Change-Id: I40e323607b2ce50869f3bf11e4582ff83cbed1c0 --- nova/virt/xenapi/agent.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/virt/xenapi/agent.py b/nova/virt/xenapi/agent.py index 577e6fcf5..7204185c3 100644 --- a/nova/virt/xenapi/agent.py +++ b/nova/virt/xenapi/agent.py @@ -193,8 +193,13 @@ def inject_file(session, instance, vm_ref, path, contents): def resetnetwork(session, instance, vm_ref): - """Calls resetnetwork method in agent.""" - _call_agent(session, instance, vm_ref, 'resetnetwork') + resp = _call_agent(session, instance, vm_ref, 'resetnetwork') + if resp['returncode'] != '0': + LOG.error(_('Failed to reset network: %(resp)r'), locals(), + instance=instance) + return None + + return resp['message'] class SimpleDH(object): -- cgit