diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-22 20:36:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-22 20:36:08 +0000 |
| commit | acb651edb360e0a6add3d16376a2071602c2b38c (patch) | |
| tree | 0772a36315c99eef6ed40987ea1a6cccbf303a74 | |
| parent | 8a1843a91a98cf5b945ed97adb82c2f820438949 (diff) | |
| parent | bcfb4d4910d678368dda48e47caf2590796cb2c9 (diff) | |
Merge "Refactor xvp console"
| -rw-r--r-- | nova/console/xvp.py | 12 |
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() |
