From 527a15ac55635978b18e317368e3080b08a99b03 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 29 Dec 2009 19:01:33 +0100 Subject: [PATCH] bdev: Add a TODO and a pylint silence A piece of old code in bdev.py uses a for loop over a single variable because we can 'break' out of the loop or exit on the 'else' path. This is not a nice usage of the for loop, it should be converted to a standard if...elif...else structure. In the meantime we silence a warning from pylint (it is actually invalid, IMHO) and add a TODO. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Olivier Tharan <olive@google.com> --- lib/bdev.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bdev.py b/lib/bdev.py index 0c87ff75a..722f12cfc 100644 --- a/lib/bdev.py +++ b/lib/bdev.py @@ -1573,6 +1573,8 @@ class DRBD8(BaseDRBD): the attach if can return success. """ + # TODO: Rewrite to not use a for loop just because there is 'break' + # pylint: disable-msg=W0631 net_data = (self._lhost, self._lport, self._rhost, self._rport) for minor in (self._aminor,): info = self._GetDevInfo(self._GetShowData(minor)) -- GitLab