On Fri, 2011-01-21 at 03:34 -0500, Jan Stancek wrote:
> - os.path.dirname(os.path.realpath('/etc/autotest.conf'))
> will never throw exception, and thus always assumed, that
> homedir is /etc -> use os.path.isfile() instead
> - os.path.join() absolute path fixed to relative
> - if autotest home can not be found, print message and exit

Hey Jan, I have applied your patches after making some fixes, mainly
related to some coding style details and one of the patches breaking one
of our unittests. The end result looks good:

http://autotest.kernel.org/changeset/5207
http://autotest.kernel.org/changeset/5208
http://autotest.kernel.org/changeset/5209

Thank you very much for cooking those fixes!

Cheers,

Lucas

> Signed-off-by: Jan Stancek <[email protected]>
> ---
>  client/tools/autotest |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/client/tools/autotest b/client/tools/autotest
> index 42f6238..8fae3f4 100755
> --- a/client/tools/autotest
> +++ b/client/tools/autotest
> @@ -2,15 +2,19 @@
>  import sys,os
>  
>  autodir = None
> -try:
> -    autodir = os.path.dirname(os.path.realpath('/etc/autotest.conf'))
> -except:
> -    pass
> +autotest_conf = os.path.realpath('/etc/autotest.conf')
> +
> +if os.path.isfile(autotest_conf):
> +    autodir = os.path.dirname(autotest_conf)
>  if not autodir:
>      for path in ['/usr/local/autotest', '/home/autotest']:
> -        if os.path.exists(os.path.join(path, '/bin/autotest')):
> +        if os.path.exists(os.path.join(path, 'bin/autotest')):
>              autodir = path
>  
> +if not autodir:
> +    print "Autotest home dir NOT FOUND"
> +    sys.exit()
> +
>  autotest = os.path.join(autodir, 'bin/autotest')
>  control = os.path.join(autodir, 'control')
>  state = os.path.join(autodir, 'control.state')


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

Reply via email to