qa/tasks/vstart_runner: add optional "sudo" param to _run_python()

to silence mypy warnings like:

tasks/vstart_runner.py:691: error: Definition of "_run_python" in base class "LocalCephFSMount" is incompatible with definition in base class "CephFSMount"
tasks/vstart_runner.py:705: error: Definition of "_run_python" in base class "LocalCephFSMount" is incompatible with definition in base class "CephFSMount"

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-07-21 11:07:55 +08:00
parent 975fd8d6f5
commit 0017df2006

View File

@ -659,12 +659,16 @@ class LocalCephFSMount():
path = "{0}/client.{1}.*.asok".format(d, self.client_id)
return path
def _run_python(self, pyscript, py_version='python'):
def _run_python(self, pyscript, py_version='python', sudo=False):
"""
Override this to remove the daemon-helper prefix that is used otherwise
to make the process killable.
"""
return self.client_remote.run(args=[py_version, '-c', pyscript],
args = []
if sudo:
args.append('sudo')
args += [py_version, '-c', pyscript]
return self.client_remote.run(args=args,
wait=False, stdout=StringIO())
def setup_netns(self):