diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-13 16:41:53 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-13 16:44:14 -0700 |
| commit | b107450cf9e89c5d93b989371b3a5f66810dbf9f (patch) | |
| tree | 1ea21039ba6015384a65c3a1e4a6b6888cb6ec86 | |
| parent | fd893daa473d22b474b36ddcee5c71ce61bee320 (diff) | |
Add more useful logging around the unmount fail case.
Raise a better message with a more useful message
rather than raising a process execution error, which
although useful is not especially meaningful.
Bug 1050645
Change-Id: Id9817de26fdb16f8fce17ebd093a9550e63be19c
| -rw-r--r-- | nova/virt/disk/guestfs.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/virt/disk/guestfs.py b/nova/virt/disk/guestfs.py index 42ec7d2ee..21e33b1d7 100644 --- a/nova/virt/disk/guestfs.py +++ b/nova/virt/disk/guestfs.py @@ -112,6 +112,10 @@ class Mount(mount.Mount): wait_cmd = 'until ! ps -C guestmount -o args= | grep -qF "%s"; ' wait_cmd += 'do sleep .2; done' wait_cmd %= self.mount_dir - utils.execute('timeout', '10s', 'sh', '-c', wait_cmd) - - self.mounted = False + try: + utils.execute('timeout', '10s', 'sh', '-c', wait_cmd) + self.mounted = False + except exception.ProcessExecutionError: + msg = _("Failed to umount image at %s, guestmount was " + "still running after 10s") % (self.mount_dir) + raise exception.NovaException(msg) |
