summaryrefslogtreecommitdiffstats
path: root/nova/console
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2012-12-16 08:56:05 -0600
committerChuck Short <chuck.short@canonical.com>2012-12-16 09:02:40 -0600
commitbcfb4d4910d678368dda48e47caf2590796cb2c9 (patch)
treed8201e28b84159240c6294d0b27bb5866716ae6b /nova/console
parentf04722ee22feed97aca23cd16864626d9672671c (diff)
downloadnova-bcfb4d4910d678368dda48e47caf2590796cb2c9.tar.gz
nova-bcfb4d4910d678368dda48e47caf2590796cb2c9.tar.xz
nova-bcfb4d4910d678368dda48e47caf2590796cb2c9.zip
Refactor xvp console
Small re-factoring of the xvp console mainly checking to make sure that we catch exceptions when they haappen. Change-Id: I0164111ffa4439d82ae26084433901236a4a2ddc Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/console')
-rw-r--r--nova/console/xvp.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/nova/console/xvp.py b/nova/console/xvp.py
index 8b2db090b..4a23e0891 100644
--- a/nova/console/xvp.py
+++ b/nova/console/xvp.py
@@ -114,9 +114,13 @@ class XVPConsoleProxy(object):
self._xvp_restart()
def _write_conf(self, config):
- LOG.debug(_('Re-wrote %s') % CONF.console_xvp_conf)
- with open(CONF.console_xvp_conf, 'w') as cfile:
- cfile.write(config)
+ try:
+ LOG.debug(_('Re-wrote %s') % CONF.console_xvp_conf)
+ with open(CONF.console_xvp_conf, 'w') as cfile:
+ cfile.write(config)
+ except IOError:
+ LOG.exception(_("Failed to write configuration file"))
+ raise
def _xvp_stop(self):
LOG.debug(_('Stopping xvp'))
@@ -194,4 +198,6 @@ class XVPConsoleProxy(object):
#xvp will blow up on passwords that are too long (mdragon)
password = password[:maxlen]
out, err = utils.execute('xvp', flag, process_input=password)
+ if err:
+ raise exception.ProcessExecutionError(_("Failed to run xvp."))
return out.strip()