summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tko/job_serializer.py53
-rw-r--r--tko/job_serializer_unittest.py9
-rw-r--r--tko/tko.proto10
3 files changed, 5 insertions, 67 deletions
diff --git a/tko/job_serializer.py b/tko/job_serializer.py
index 4fff8e93..f9502068 100644
--- a/tko/job_serializer.py
+++ b/tko/job_serializer.py
@@ -55,14 +55,10 @@ class JobSerializer(object):
'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 @@ class JobSerializer(object):
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 @@ class JobSerializer(object):
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
diff --git a/tko/job_serializer_unittest.py b/tko/job_serializer_unittest.py
index 222cc657..7cad8929 100644
--- a/tko/job_serializer_unittest.py
+++ b/tko/job_serializer_unittest.py
@@ -224,15 +224,6 @@ class JobSerializerUnittest(unittest.TestCase):
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
diff --git a/tko/tko.proto b/tko/tko.proto
index b51cd541..8d8939fb 100644
--- a/tko/tko.proto
+++ b/tko/tko.proto
@@ -1,3 +1,4 @@
+
syntax = "proto2";
message Job {
@@ -8,14 +9,7 @@ message Job {
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 {