[Fuego] [PATCH 13/30] ftc exec: convert timeout to time units

Tim.Bird at sony.com Tim.Bird at sony.com
Wed Jun 6 01:57:35 UTC 2018



> -----Original Message-----
> From: Daniel Sangorrin
> Sent: Monday, June 04, 2018 12:18 AM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 13/30] ftc exec: convert timeout to time units
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/scripts/ftc | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/engine/scripts/ftc b/engine/scripts/ftc
> index 7a9d23c..fc900ed 100755
> --- a/engine/scripts/ftc
> +++ b/engine/scripts/ftc
> @@ -2966,7 +2966,14 @@ def ftc_exec_command(command, timeout):
> 
>      # specify timeout for command operation
>      signal.signal(signal.SIGALRM, alarm_handler)
> -    signal.alarm(timeout)
> +
> +    # timeout is passed as integer[dhms] (dhms: days, hours, minutes,
> seconds)
> +    print "timeout is: " + timeout
> +    units = timeout[:-1]
> +    multiplier = {"d": 24*60*60, "h": 60*60, "m": 60, "s": 1}
> +    time = int(units)*multiplier[timeout[-1]]
We have a global 'time' module defined, which this
name conflicts with.  I'm changing this to 'time_secs',
unless you have some objection.

> +    print "setting alarm to: " + str(time) + " seconds"
> +    signal.alarm(time)
> 
>      try:
>          # p.poll returns exit code when process completes
> --
> 2.7.4

Thanks.  BTW - everything up to this is applied.  I'm working
through the list. :-)
 -- Tim



More information about the Fuego mailing list