On Thu, Feb 10, 2011 at 02:30:58AM -0500, Jan Stancek wrote:
> Right, the try-except-finally won't work in 2.4, sorry about that.

Ack

btw, lmr, the latest autotest always hangs with python2.4
but it's fine with python2.6

[root@t173 kvm]# ../../bin/autotest control  --verbose
16:41:47 INFO | Writing results to 
/home/devel/autotest-upstream/client/results/default
16:41:47 INFO | Initializing the state engine
16:41:47 DEBUG| Persistent state client.steps now set to []
16:41:47 DEBUG| Selected harness: standalone
16:41:47 INFO | Symlinking init scripts
16:41:47 DEBUG| Running 'grep :initdefault: /etc/inittab'
16:41:47 DEBUG| Running 'ln -sf 
/home/devel/autotest-upstream/client/tools/autotest /etc/init.d/autotest'
16:41:47 DEBUG| Running 'ln -sf 
/home/devel/autotest-upstream/client/tools/autotest /etc/rc5.d/S99autotest'
16:41:47 DEBUG| Dropping caches
16:41:47 DEBUG| Running 'sync'
16:41:47 DEBUG| Running 'echo 3 > /proc/sys/vm/drop_caches'
[hang]...



> diff --git a/client/bin/job.py b/client/bin/job.py
> index 3e285c6..ded3987 100644
> --- a/client/bin/job.py
> +++ b/client/bin/job.py
> @@ -599,26 +599,27 @@ class base_client_job(base_job.base_job):
>          """
>  
>          try:
> -            self.record('START', subdir, testname)
> -            self._state.set('client', 'unexpected_reboot', (subdir, 
> testname))
> -            result = function(*args, **dargs)
> -            self.record('END GOOD', subdir, testname)
> -            return result
> -        except error.TestBaseException, e:
> -            self.record('END %s' % e.exit_status, subdir, testname)
> -            raise
> -        except error.JobError, e:
> -            self.record('END ABORT', subdir, testname)
> -            raise
> -        except Exception, e:
> -            # This should only ever happen due to a bug in the given
> -            # function's code.  The common case of being called by
> -            # run_test() will never reach this.  If a control file called
> -            # run_group() itself, bugs in its function will be caught
> -            # here.
> -            err_msg = str(e) + '\n' + traceback.format_exc()
> -            self.record('END ERROR', subdir, testname, err_msg)
> -            raise
> +            try:
> +                self.record('START', subdir, testname)
> +                self._state.set('client', 'unexpected_reboot', (subdir, 
> testname))
> +                result = function(*args, **dargs)
> +                self.record('END GOOD', subdir, testname)
> +                return result
> +            except error.TestBaseException, e:
> +                self.record('END %s' % e.exit_status, subdir, testname)
> +                raise
> +            except error.JobError, e:
> +                self.record('END ABORT', subdir, testname)
> +                raise
> +            except Exception, e:
> +                # This should only ever happen due to a bug in the given
> +                # function's code.  The common case of being called by
> +                # run_test() will never reach this.  If a control file called
> +                # run_group() itself, bugs in its function will be caught
> +                # here.
> +                err_msg = str(e) + '\n' + traceback.format_exc()
> +                self.record('END ERROR', subdir, testname, err_msg)
> +                raise
>          finally:
>              self._state.discard('client', 'unexpected_reboot')
> 
> 
> ----- Original Message -----
> From: "Amos Kong" <[email protected]>
> To: [email protected]
> Cc: [email protected]
> Sent: Thursday, February 10, 2011 7:17:23 AM
> Subject: [Autotest] unsupported syntax by python 2.4
> 
> 
> the following commit contains an unsupported syntax (python 2.4)
> 
> commit ce81d75569cd72a16beae359e6a8f5d91d1d5f88
> Author: lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
> Date:   Sat Jan 29 01:21:40 2011 +0000
> 
>     Let harness know about failed test after unexpected reboot
> 
>     If test causes unexpected reboot, its state is not logged
>     and harness also doesn't get called. Side-effect is
>     that group_level/indent_level will be more than expected
>     and autotest fails with AssertionError.
> 
>     Signed-off-by: Jan Stancek <[email protected]>
> 
> [root@t173 kvm]# ../../bin/autotest control --verbose
> Traceback (most recent call last):
>   File "../../bin/autotest", line 8, in ?
>     from autotest_lib.client.bin import job
>   File "/home/devel/autotest-upstream/client/bin/job.py", line 622
>     finally:
>           ^
> SyntaxError: invalid syntax
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to