On Tue, 2010-08-31 at 11:26 -0700, Gregory Smith wrote:
> Use execfile to run the client/deps/ setup .py files instead of
> launching them as their own subprocess.  None of them do anything
> beyond just importing the autotest utils module for utils.system()
> anyways and none of them call sys.exit() so this makes it easier.
> 
> Why?  We have our autotest client packaged up as a bundle such that
> subprocesses wouldn't be able to find and import code from its
> autotest_lib.client without gross hackery.  Using execfile allows
> the deps to remain individually packaged without needing to be bundled
> up with their own copy of the supporting client utils code that they
> depend on.
> 
> As these are no longer run as their own process but ran in process,
> their common.py imports and files are no longer needed.
> 
> TESTED: I ran a client tsc test using a client with this change
> which fetches our gcc64 dependency, runs it via execfile and builds
> the code.

This looks very good to me, I really liked this cleanup. As the return
of execfile is None, to avoid having a non helpful message in the logs,
I slightly changed the code that calls execfile to look like this:

            os.chdir(dep_dir)
            if execfile('%s.py' % dep, {}) is None:
                logging.info('Dependency %s successfuly built', dep)

Tested it running fsx, systemtap client tests, and commited it, see

http://autotest.kernel.org/changeset/4807

Thank you very much for doing this,

Lucas

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

Reply via email to