diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-11 21:36:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-11 21:36:59 +0000 |
| commit | 6e2e058bf568981c4c861d6f0ef052d17c1c9651 (patch) | |
| tree | 3bf1ae4f78f75aeca5a7f1291cfdd77cf189d548 /nova | |
| parent | 1f024f55e191428341692aba7ebf3fd8144f982d (diff) | |
| parent | e5b92d600c4f393bcb7d276b863b0198713f560e (diff) | |
| download | nova-6e2e058bf568981c4c861d6f0ef052d17c1c9651.tar.gz nova-6e2e058bf568981c4c861d6f0ef052d17c1c9651.tar.xz nova-6e2e058bf568981c4c861d6f0ef052d17c1c9651.zip | |
Merge "Catch ProcessExecutionError when building config drives."
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/configdrive.py | 6 | ||||
| -rw-r--r-- | nova/virt/hyperv/vmops.py | 4 | ||||
| -rw-r--r-- | nova/virt/libvirt/driver.py | 6 |
3 files changed, 16 insertions, 0 deletions
diff --git a/nova/virt/configdrive.py b/nova/virt/configdrive.py index ad6e0240a..f5f881532 100644 --- a/nova/virt/configdrive.py +++ b/nova/virt/configdrive.py @@ -136,6 +136,12 @@ class ConfigDriveBuilder(object): shutil.rmtree(mountdir) def make_drive(self, path): + """Make the config drive. + + :param path: the path to place the config drive image at + + :raises ProcessExecuteError if a helper process has failed. + """ if CONF.config_drive_format == 'iso9660': self._make_iso9660(path) elif CONF.config_drive_format == 'vfat': diff --git a/nova/virt/hyperv/vmops.py b/nova/virt/hyperv/vmops.py index 480eb394f..fea1034f4 100644 --- a/nova/virt/hyperv/vmops.py +++ b/nova/virt/hyperv/vmops.py @@ -197,6 +197,10 @@ class VMOps(baseops.BaseOps): cdb = configdrive.ConfigDriveBuilder(instance_md=inst_md) try: cdb.make_drive(configdrive_path_iso) + except exception.ProcessExecutionError, e: + LOG.error(_('Creating config drive failed with error: %s'), + e, instance=instance) + raise finally: cdb.cleanup() diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 45d89e175..dbc2346be 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1449,7 +1449,13 @@ class LibvirtDriver(driver.ComputeDriver): configdrive_path = basepath(fname='disk.config') LOG.info(_('Creating config drive at %(path)s'), {'path': configdrive_path}, instance=instance) + cdb.make_drive(configdrive_path) + except exception.ProcessExecutionError, e: + LOG.error(_('Creating config drive failed with error: %s'), + e, instance=instance) + raise + finally: cdb.cleanup() |
