Handle device being pulled with queued device jobs gracefully

This commit is contained in:
Kovid Goyal 2010-06-25 10:29:34 -06:00
parent 4e4a69cdc5
commit adcd0c6b28

View File

@ -75,10 +75,16 @@ class DeviceJob(BaseJob): # {{{
self.job_done()
def abort(self, err):
call_job_done = False
if self.run_state == self.WAITING:
self.start_work()
call_job_done = True
self._aborted = True
self.failed = True
self._details = unicode(err)
self.exception = err
if call_job_done:
self.job_done()
@property
def log_file(self):