From c13078bc0f1935817d978ddbc2439571a85372b0 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Mon, 23 Jan 2012 22:10:49 +0000 Subject: Error out instance on set password failure. Fixes bug 920643 Change-Id: Ieb4724d44f50c217ce5f25d809c40ca6c6cdeed8 --- nova/virt/xenapi/vmops.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 665584072..606da3bcc 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -930,8 +930,9 @@ class VMOps(object): resp = self._make_agent_call('key_init', instance, '', key_init_args) # Successful return code from key_init is 'D0' if resp['returncode'] != 'D0': - LOG.error(_('Failed to exchange keys: %(resp)r') % locals()) - return None + msg = _('Failed to exchange keys: %(resp)r') % locals() + LOG.error(msg) + raise Exception(msg) # Some old versions of the Windows agent have a trailing \\r\\n # (ie CRLF escaped) for some reason. Strip that off. agent_pub = int(resp['message'].replace('\\r\\n', '')) @@ -945,8 +946,9 @@ class VMOps(object): resp = self._make_agent_call('password', instance, '', password_args) # Successful return code from password is '0' if resp['returncode'] != '0': - LOG.error(_('Failed to update password: %(resp)r') % locals()) - return None + msg = _('Failed to update password: %(resp)r') % locals() + LOG.error(msg) + raise Exception(msg) return resp['message'] def inject_file(self, instance, path, contents): -- cgit