the open of chroot lock file is unneccessary, remove it;
if chroot_lock is None, release is invalid, check it.
Signed-off-by: Gui Chen <gui.chen@intel.com>
# update /etc/mtab
setup_mtab(chrootdir)
- # lock
- chroot_lock = os.path.join(chrootdir, ".chroot.lock")
- chroot_lockfd = open(chroot_lock, "w")
-
return None
######################################################################
# clean up mounts
cleanup_mounts(chrootdir)
# release the lock
- chroot_lock.release()
+ if chroot_lock:
+ chroot_lock.release()
+ chroot_lock = None
return None