Add verification of RPC results in _WipeDisks
authorIustin Pop <iustin@google.com>
Wed, 15 Aug 2012 09:46:30 +0000 (11:46 +0200)
committerIustin Pop <iustin@google.com>
Wed, 15 Aug 2012 09:59:29 +0000 (11:59 +0200)
commitf08e513223f49f9f73f792c691ef461e68300181
tree3759ef24c5995f5a5958ddaa0088efe502286b89
parentb2631ce49a512acd009d3f6d3360c5a96d5f88bb
Add verification of RPC results in _WipeDisks

Due to an oversight, the pause/resume sync RPC calls in _WipeDisks
lack the verification of the overall RPC status, and directly iterate
over the payload. The code actually doing the wipe does verify
correctly the results. This can result in jobs failing with a hard to
diagnose:

OpExecError ['NoneType' object is not iterable]

instead of proper "RPC failed" message.

This patch adds a hard check on the pause call, but for the resume
call it just logs a warning if the RPC failed; the rationale being
that if we can't contact the node for pausing the sync, it's likely
wiping will fail too, but after the wipe has been done, we can
continue.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>
lib/cmdlib.py