Fix bug in job create where synch_count was being overridden by
generate_control_file.
Risk(Medium): Modifying job create CLI
Visibility(Low): Should only fix broken synch_counts

Signed-off-by: Ryan Kubiak <rkubiak@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2664 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/cli/job.py b/cli/job.py
index 78e2992..640a986 100755
--- a/cli/job.py
+++ b/cli/job.py
@@ -224,8 +224,7 @@
                                'urgent'), default='medium')
         self.parser.add_option('-y', '--synch_count', type=int,
                                help='Number of machines to use per autoserv '
-                                    'execution',
-                               default=1)
+                                    'execution')
         self.parser.add_option('-c', '--container', help='Run this client job '
                                'in a container', action='store_true',
                                default=False)
@@ -352,7 +351,8 @@
         self.data['dependencies'] = deps
 
         self.data['email_list'] = options.email
-        self.data['synch_count'] = options.synch_count
+        if options.synch_count:
+            self.data['synch_count'] = options.synch_count
         if options.server:
             self.data['control_type'] = 'Server'
         else:
@@ -375,7 +375,8 @@
                 print 'Done'
                 socket.setdefaulttimeout(topic_common.DEFAULT_SOCKET_TIMEOUT)
             self.data['control_file'] = cf_info['control_file']
-            self.data['synch_count'] = cf_info['synch_count']
+            if 'synch_count' not in self.data:
+                self.data['synch_count'] = cf_info['synch_count']
             if cf_info['is_server']:
                 self.data['control_type'] = 'Server'
             else:
@@ -386,6 +387,9 @@
             deps = sorted(deps.union(cf_info['dependencies']))
             self.data['dependencies'] = list(deps)
 
+        if 'synch_count' not in self.data:
+            self.data['synch_count'] = 1
+
         if self.clone_id:
             clone_info = self.execute_rpc(op='get_info_for_clone',
                                           id=self.clone_id,