Disregarding patches in the job serializing process because they are never used 
in our system anymore. Patches still exist in tko.

OK to submit to non-main branch.

Signed-off-by: Darren Kuo <[email protected]>

--- autotest/tko/job_serializer.py      2010-07-16 09:31:19.000000000 -0700
+++ autotest/tko/job_serializer.py      2010-07-16 09:31:19.000000000 -0700
@@ -55,14 +55,10 @@
                                'iterations':list, 'attributes':dict,
                                'labels':list}
 
-        self.kernel_type_dict = {'base':str, 'patches':list,
-                                 'kernel_hash':str }
+        self.kernel_type_dict = {'base':str, 'kernel_hash':str}
 
         self.iteration_type_dict = {'index':int, 'attr_keyval':dict,
-                                    'perf_keyval':dict }
-
-        self.patch_type_dict = {'spec':str, 'reference':str,
-                                'hash':int}
+                                    'perf_keyval':dict}
 
 
     def deserialize_from_binary(self, infile):
@@ -279,11 +275,7 @@
 
         fields_dict = self.get_trivial_attr(kernel, self.kernel_type_dict)
 
-        fields_dict['patches'] = [self.get_tko_patch(patch) for patch
-                                  in kernel.patches]
-
-        return models.kernel(fields_dict['base'], fields_dict['patches'],
-                             fields_dict['kernel_hash'])
+        return models.kernel(fields_dict['base'], [], 
fields_dict['kernel_hash'])
 
 
     def set_pb_kernel(self, tko_kernel, pb_kernel):
@@ -301,45 +293,6 @@
 
         self.set_trivial_attr(tko_kernel, pb_kernel, self.kernel_type_dict)
 
-        for patch in tko_kernel.patches:
-            newpatch = pb_kernel.patches.add()
-            self.set_pb_patch(patch, newpatch)
-
-
-    def get_tko_patch(self, patch):
-        """Constructs a new tko patch object from the provided pb
-        patch instance.
-
-        Extracts data from the provided pb patch and creates a new tko
-        patch using the models.patch constructor.
-
-        @param
-        patch: a pb patch that contains the data for the new tko patch
-
-        @return a new tko patch with the same data as in the pb patch.
-        """
-
-        fields_dict = self.get_trivial_attr(patch, self.patch_type_dict)
-        return models.patch(fields_dict['spec'],
-                            fields_dict['reference'],
-                            fields_dict['hash'])
-
-
-    def set_pb_patch(self, tko_patch, pb_patch):
-        """Set a specific patch of a kernel.
-
-        Takes the same form of all the other setting methods.  It
-        seperates the string variables from the int variables and set
-        them safely.
-
-        @param
-        tko_patch: a tko patch.
-        pb_patch: an empty protocol buffer patch.
-
-        """
-
-        self.set_trivial_attr(tko_patch, pb_patch, self.patch_type_dict)
-
 
     def get_tko_iteration(self, iteration):
         """Creates a new tko iteration with the data in the provided
--- autotest/tko/job_serializer_unittest.py     2010-07-16 09:31:19.000000000 
-0700
+++ autotest/tko/job_serializer_unittest.py     2010-07-16 09:31:19.000000000 
-0700
@@ -224,15 +224,6 @@
         self.assertEqual(kernel.base, newkernel.base)
         self.assertEqual(kernel.kernel_hash, newkernel.kernel_hash)
 
-        self.check_patches(kernel.patches, newkernel.patches)
-
-
-    def check_patches(self, patches, newpatches):
-        for patch, newpatch in zip(patches, newpatches):
-            self.assertEqual(patch.spec, newpatch.spec)
-            self.assertEqual(patch.reference, newpatch.reference)
-            self.assertEqual(patch.hash, newpatch.hash)
-
 
 class ReadBackTest(JobSerializerUnittest):
     """Check if convert between models.job and pb job is correct even
--- autotest/tko/tko.proto      2010-07-16 09:31:19.000000000 -0700
+++ autotest/tko/tko.proto      2010-07-16 09:31:19.000000000 -0700
@@ -1,3 +1,4 @@
+
 syntax = "proto2";
 
 message Job {
@@ -8,14 +9,7 @@
 
     message Kernel {
         required string base = 1;
-        repeated Patch patches = 2;
-        required string kernel_hash = 3;
-    }
-
-    message Patch {
-        required string spec = 1;
-        required string reference = 2;
-        required int64 hash = 3;
+        required string kernel_hash = 2;
     }
 
     message Iteration {
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to