Fix the missing 'os' import.
Allow prepare_generate_control_file() to work with an empty list of tests.
Signed-off-by: Gregory Smith <gps@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2722 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index bdff059..23a51f7 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -5,7 +5,7 @@
__author__ = 'showard@google.com (Steve Howard)'
-import datetime, xmlrpclib, threading
+import datetime, os
from frontend.afe import models, model_logic
NULL_DATETIME = datetime.datetime.max
@@ -146,7 +146,10 @@
test1.name, test2.name)})
is_server = (test_type == models.Test.Types.SERVER)
- synch_count = max(test.sync_count for test in test_objects)
+ if test_objects:
+ synch_count = max(test.sync_count for test in test_objects)
+ else:
+ synch_count = 1
if label:
label = models.Label.smart_get(label)