On Fri, Sep 3, 2010 at 2:31 PM, Michael Hanselmann <[email protected]> wrote:
> Am 3. September 2010 13:17 schrieb Manuel Franceschini <[email protected]>:
>> --- a/lib/backend.py
>> +++ b/lib/backend.py
>> @@ -306,7 +306,10 @@ def StartMaster(start_daemons, no_voting):
>>         utils.RunCmd(["arping", "-q", "-U", "-c 3", "-I", master_netdev, 
>> "-s",
>>                       master_ip, master_ip])
>>       elif ipcls == netutils.IP6Address:
>> -        utils.RunCmd(["ndisc6", "-q", "-r 3", master_ip, master_netdev])
>> +        try:
>> +          utils.RunCmd(["ndisc6", "-q", "-r 3", master_ip, master_netdev])
>> +        except errors.OpExecError:
>> +          logging.warning("Can't execute ndisc6, please install if missing")
>
> IIRC, RunCmd doesn't raise an exception. Use its return value and
> include error code and message in the log message. See other places
> where RunCmd is used.

It does raise an exception in exactly that case (ENOENT) that I want
to catch here.


Manuel

Reply via email to