cros_sdk.py: Add better logging around delete/unmount.
BUG=chromium:1095661
TEST=manual, run_tests
Change-Id: I9e0f84c21334106396f3e09cc6b60aa20e496056
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2298601
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Michael Mortensen <mmortensen@google.com>
Tested-by: Michael Mortensen <mmortensen@google.com>
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index 97fe3a9..8ca6158 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -986,6 +986,9 @@
logging.error('Acquiring write_lock on %s failed: %s', lock_path, e)
if not options.force:
cros_build_lib.Die('Exiting; use --force to continue w/o lock.')
+ else:
+ logging.warning(
+ 'cros_sdk was invoked with force option, continuing.')
if missing_image_tools:
logging.notice('Unmounting chroot.')
osutils.UmountTree(options.chroot)
@@ -1006,6 +1009,9 @@
lock.write_lock()
except timeout_util.TimeoutError as e:
logging.error('Acquiring write_lock on %s failed: %s', lock_path, e)
+ logging.warning(
+ 'Continuing with CleanupChroot(%s), which will umount the tree.',
+ options.chroot)
# We can call CleanupChroot (which calls cros_sdk_lib.CleanupChrootMount)
# even if we don't get the lock because it will attempt to unmount the
# tree and will print diagnostic information from 'fuser', 'lsof', and