Simplify RPC call result check in cmdlib.py
Now that all results are the same, we can even more simplify the handling in cmdlib more. Almost all if result.RemoteFailMsg()… constructs are similar, and we resurect the RpcResult.Raise() function to take a message argument, which it will process and raise an appropriate exception. This means a significant reduce in boilerplate code. Only the cases which handle the error specially (e.g. by warning only) need to touch directly the failure message, which was renamed on the RpcResult object for more clarity. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
Loading
Please register or sign in to comment