The python function string.find() returns -1 on a miss, which is also evaluated as True. Therefore use the "X in Y" approach instead. Also added a rather trivial test to test for this code bug. In order to make the code easier to test, I've changed the parameters to operate on the command output, not the exception object and updated all callers. Change-Id: If0b4fed6fe676cad50512267c1b601a3a8a631e5
36 KiB
36 KiB