diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 282: kill the process talking to the device under test on process exit (Abner Silva)

Message ID 20120509014311.16404.93610.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson May 9, 2012, 1:43 a.m. UTC
Merge authors:
  Abner Silva (abnerf)
Related merge proposals:
  https://code.launchpad.net/~abnerf/lava-dispatcher/lava-dispatcher/+merge/105112
  proposed by: Abner Silva (abnerf)
  review: Approve - Michael Hudson-Doyle (mwhudson)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 282 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Wed 2012-05-09 13:39:33 +1200
message:
  kill the process talking to the device under test on process exit (Abner Silva)
modified:
  lava_dispatcher/client/master.py


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

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

Patch

=== modified file 'lava_dispatcher/client/master.py'
--- lava_dispatcher/client/master.py	2012-05-07 01:54:39 +0000
+++ lava_dispatcher/client/master.py	2012-05-08 18:35:36 +0000
@@ -28,6 +28,7 @@ 
 from tempfile import mkdtemp
 import time
 import traceback
+import atexit
 
 import pexpect
 import errno
@@ -271,11 +272,15 @@ 
         #serial can be slow, races do funny things if you don't increase delay
         proc.delaybeforesend=1
         self.proc = proc
+        atexit.register(self._close_logging_spawn)
 
     @property
     def master_str(self):
         return self.device_option("MASTER_STR")
 
+    def _close_logging_spawn(self):
+        self.proc.close(True)
+
     def decompress(self, image_file):
         for suffix, command in [('.gz', 'gunzip'),
                                 ('.xz', 'unxz'),