diff mbox

[Branch,~linaro-validation/lava-test/trunk] Rev 71: Add analyzer_assigned_uuid back (previously removed due to bad commit)

Message ID 20110614184824.2910.83464.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson June 14, 2011, 6:48 p.m. UTC
------------------------------------------------------------
revno: 71
committer: Paul Larson <paul.larson@canonical.com>
branch nick: lava-test
timestamp: Tue 2011-06-14 13:43:45 -0500
message:
  Add analyzer_assigned_uuid back (previously removed due to bad commit)
modified:
  abrek/testdef.py


--
lp:lava-test
https://code.launchpad.net/~linaro-validation/lava-test/trunk

You are subscribed to branch lp:lava-test.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'abrek/testdef.py'
--- abrek/testdef.py	2011-06-07 21:18:06 +0000
+++ abrek/testdef.py	2011-06-14 18:43:45 +0000
@@ -21,6 +21,7 @@ 
 import time
 from commands import getstatusoutput
 from datetime import datetime
+from uuid import uuid1
 
 from abrek import swprofile, hwprofile
 from abrek.api import ITest
@@ -91,7 +92,7 @@ 
         if os.path.exists(path):
             shutil.rmtree(path)
 
-    def _savetestdata(self):
+    def _savetestdata(self, analyzer_assigned_uuid):
         TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
         bundle = {
             'format': 'Dashboard Bundle Format 1.2',
@@ -99,6 +100,7 @@ 
                 {
                     'test_id': self.testname,
                     'analyzer_assigned_date': self.runner.starttime.strftime(TIMEFORMAT),
+                    'analyzer_assigned_uuid': analyzer_assigned_uuid,
                     'time_check_performed': False,
                     'hardware_context': hwprofile.get_hardware_context(),
                     'software_context': swprofile.get_software_context(),
@@ -114,6 +116,7 @@ 
             raise RuntimeError("no test runner defined for '%s'" %
                                 self.testname)
         config = get_config()
+        uuid = str(uuid1())
         installdir = os.path.join(config.installdir, self.testname)
         resultname = (self.testname +
                      str(time.mktime(datetime.utcnow().timetuple())))
@@ -122,7 +125,7 @@ 
         try:
             os.chdir(installdir)
             self.runner.run(self.resultsdir, quiet=quiet)
-            self._savetestdata()
+            self._savetestdata(uuid)
         finally:
             os.chdir(self.origdir)
         result_id = os.path.basename(self.resultsdir)