process: launch_sync: allow non success return
Change-Id: I0617335b594ba565cf2e5ffd0edfb8bffa398c48
This commit is contained in:
parent
79df739c07
commit
78087beaa9
|
@ -77,7 +77,7 @@ class Process(log.Origin):
|
||||||
self.set_name(self.name_str, pid=self.process_obj.pid)
|
self.set_name(self.name_str, pid=self.process_obj.pid)
|
||||||
self.log('Launched')
|
self.log('Launched')
|
||||||
|
|
||||||
def launch_sync(self):
|
def launch_sync(self, raise_nonsuccess=True):
|
||||||
'''
|
'''
|
||||||
calls launch() method and block waiting for it to finish, serving the
|
calls launch() method and block waiting for it to finish, serving the
|
||||||
mainloop meanwhile.
|
mainloop meanwhile.
|
||||||
|
@ -88,9 +88,10 @@ class Process(log.Origin):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.terminate()
|
self.terminate()
|
||||||
raise e
|
raise e
|
||||||
if self.result != 0:
|
if raise_nonsuccess and self.result != 0:
|
||||||
log.ctx(self)
|
log.ctx(self)
|
||||||
raise log.Error('Exited in error')
|
raise log.Error('Exited in error %d' % self.result)
|
||||||
|
return self.result
|
||||||
|
|
||||||
def respawn(self):
|
def respawn(self):
|
||||||
self.dbg('respawn')
|
self.dbg('respawn')
|
||||||
|
|
Loading…
Reference in New Issue