BmapCopy.py: fix a bug when copying without bmap
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 21 Nov 2012 14:38:21 +0000 (16:38 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 21 Nov 2012 14:40:56 +0000 (16:40 +0200)
commit4d297d82783d3f378c1d7597a51d13e217bbb033
treea6eb82cc3daa3015e19e1df54443b278841aaab0
parent05785ff98c3a711068c2e1976793ca98cb21f9bb
BmapCopy.py: fix a bug when copying without bmap

Fix a regression introduced in version 0.5: when copying without bmap the
script fails with the following error:

AttributeError: BmapCopy instance has no attribute '_f_bmap'

This is because we never define this attribute when there is no bmap, but still
use it. The fix is:

1. Define all attributes in the __init__ constructor.
2. Always check if _f_bmap is not None before using it.

While on it, do a minor space clean-up.

Change-Id: I3f729588d33be8e2a447fca817b994500840503a
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/BmapCopy.py