So there are some cases when the command is not found, which will return
with exit code of 127, and other cases when runlevel can't find
/var/run/utmp, which returns an exit code of 1.

If there is an error with runlevel then we're not going to get the needed
info out, so I think returning False is ok here, as it will let AutoTest
continue on it's merry way.

Kelly

On Tue, Feb 16, 2010 at 8:26 AM, John Admanski <[email protected]> wrote:

> If the expected failure mode is a lack of runlevel, it should probably be
> explicitly checking for the command failing with exit code 127 instead of
> just swallowing all errors.
>
> Also, it would be nice if there was some alternate method of checking for
> "is the machine shutting down", but maybe that's just not possible.
>
> On Fri, Feb 12, 2010 at 11:16 AM, K.D. Lucas <[email protected]> wrote:
>
>> My team is working with an operating system that doesn't support runlevel,
>> so I'd like to wrap that in a try block.
>>
>> --
>> K.D. Lucas
>> [email protected]
>>
>> _______________________________________________
>> Autotest mailing list
>> [email protected]
>> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>>
>>
>


-- 
K.D. Lucas
[email protected]
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to