From: Artem Bityutskiy Date: Mon, 14 Jan 2013 14:46:42 +0000 (+0200) Subject: BmapCopy: restore the block device settings X-Git-Tag: v2.0~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3819cc7ae9dff085b7f5b206655fba02e4220075;p=tools%2Fbmap-tools.git BmapCopy: restore the block device settings Always restore the block device settings at the end. Change-Id: I04ba70598b2e9616d22790248795a460ec710400 Signed-off-by: Artem Bityutskiy --- diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py index dbd2a07..7082287 100644 --- a/bmaptools/BmapCopy.py +++ b/bmaptools/BmapCopy.py @@ -574,12 +574,14 @@ class BmapBdevCopy(BmapCopy): very bad user experience, and we work around this effect by synchronizing from time to time. """ + self._tune_block_device() + try: - self._tune_block_device() BmapCopy.copy(self, sync, verify) except: - self._restore_bdev_settings() raise + finally: + self._restore_bdev_settings() def __init__(self, image, dest, bmap = None, image_size = None): """ The same as the constructor of the 'BmapCopy' base class, but adds