core: Add 'wait' parameter to vm.run_service function
Sometimes it makes sense to "fire and forget" a service. For example "qubes.InstallUpdatesGUI". QubesOS/qubes-issues#1249
This commit is contained in:
parent
74d9c62025
commit
4316027fb1
@ -1616,20 +1616,21 @@ class QubesVm(object):
|
|||||||
return retcode
|
return retcode
|
||||||
|
|
||||||
def run_service(self, service, source="dom0", user=None,
|
def run_service(self, service, source="dom0", user=None,
|
||||||
passio_popen=False, input=None, localcmd=None, gui=False):
|
passio_popen=False, input=None, localcmd=None, gui=False,
|
||||||
|
wait=True):
|
||||||
if bool(input) + bool(passio_popen) + bool(localcmd) > 1:
|
if bool(input) + bool(passio_popen) + bool(localcmd) > 1:
|
||||||
raise ValueError("'input', 'passio_popen', 'localcmd' cannot be "
|
raise ValueError("'input', 'passio_popen', 'localcmd' cannot be "
|
||||||
"used together")
|
"used together")
|
||||||
if localcmd:
|
if localcmd:
|
||||||
return self.run("QUBESRPC %s %s" % (service, source),
|
return self.run("QUBESRPC %s %s" % (service, source),
|
||||||
localcmd=localcmd, user=user, wait=True, gui=gui)
|
localcmd=localcmd, user=user, wait=wait, gui=gui)
|
||||||
elif input:
|
elif input:
|
||||||
return self.run("QUBESRPC %s %s" % (service, source),
|
return self.run("QUBESRPC %s %s" % (service, source),
|
||||||
localcmd="echo %s" % input, user=user, wait=True,
|
localcmd="echo %s" % input, user=user, wait=wait,
|
||||||
gui=gui)
|
gui=gui)
|
||||||
else:
|
else:
|
||||||
return self.run("QUBESRPC %s %s" % (service, source),
|
return self.run("QUBESRPC %s %s" % (service, source),
|
||||||
passio_popen=passio_popen, user=user, wait=True,
|
passio_popen=passio_popen, user=user, wait=wait,
|
||||||
gui=gui)
|
gui=gui)
|
||||||
|
|
||||||
def attach_network(self, verbose = False, wait = True, netvm = None):
|
def attach_network(self, verbose = False, wait = True, netvm = None):
|
||||||
|
Loading…
Reference in New Issue
Block a user