From b107450cf9e89c5d93b989371b3a5f66810dbf9f Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 13 Sep 2012 16:41:53 -0700 Subject: 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 --- nova/virt/disk/guestfs.py | 10 +++++++--- 1 file 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) -- cgit