summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2012-01-23 22:10:49 +0000
committerRick Harris <rconradharris@gmail.com>2012-01-23 22:10:49 +0000
commitc13078bc0f1935817d978ddbc2439571a85372b0 (patch)
tree70dc2eed67ed724c1e4699259e891eb3c0d99557
parent152da40a0651bfbdeb748c249e771c10e716c79c (diff)
Error out instance on set password failure.
Fixes bug 920643 Change-Id: Ieb4724d44f50c217ce5f25d809c40ca6c6cdeed8
-rw-r--r--nova/virt/xenapi/vmops.py10
1 files 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):