On 03/12/2013 02:26 PM, [email protected] wrote:
From: Cheri Van Pelt <[email protected]>

Some older machines are taking longer than 5 seconds to sync before
reboot.  To accomodate these machines the sleep time is parameterized.
The default sleep time is 5 seconds, but if additional time is needed,
the sleep_before_reboot variable in global_config.ini can be adjusted
to allow for more time.

Tested-by: Julius Gawlas <[email protected]>
---
  client/job.py     | 5 ++++-
  global_config.ini | 2 ++
  2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/client/job.py b/client/job.py
index 43dabde..5e0734f 100644
--- a/client/job.py
+++ b/client/job.py
@@ -895,7 +895,10 @@ class base_client_job(base_job.base_job):
          # sync first, so that a sync during shutdown doesn't time out
          utils.system("sync; sync", ignore_status=True)

-        utils.system("(sleep 5; reboot) </dev/null >/dev/null 2>&1 &")
+        sleep_before_reboot = settings.get_value('CLIENT', 
'sleep_before_reboot',
+                                                  default="5")
+
+        utils.system("(sleep {0}; reboot) </dev/null >/dev/null 2>&1 
&".format(sleep_before_reboot))

^ Nice patch. However, the .format string method is new on python 2.6, and that makes this not suitable for autotest (we strive to keep 2.4 compatibility). So, what about use a more traditional approach, like:

sleep_cmd = "(sleep %s; reboot) </dev/null >/dev/null 2>&1 &" % sleep_before_reboot
utils.system(sleep_cmd)

This is valid py 2.4 and accomplishes the same.

Would you please re-spin the patch and send a v2, with this fixed?

Thanks!

Lucas

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to