From 0017df2006bda64973799ab50735477674c3a5cd Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 21 Jul 2021 11:07:55 +0800 Subject: [PATCH 1/2] 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 --- qa/tasks/vstart_runner.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 55d8af8beea76..851816b2c3df5 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -659,12 +659,16 @@ def _asok_path(self): 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): From ffbc3164d4606bbc0e6cd7859f6c0e77af602b53 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 22 Jul 2021 10:08:47 +0800 Subject: [PATCH 2/2] cmake: add "mypy" back to tox envlist of "qa"" This reverts commit 286e46578dcf35ab096dd242338f3751c248683c. since 0017df2006bda64973799ab50735477674c3a5cd has been merged, let's add mypy back. Signed-off-by: Kefu Chai --- qa/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/CMakeLists.txt b/qa/CMakeLists.txt index fd95d83833b3c..884c41e4bbafe 100644 --- a/qa/CMakeLists.txt +++ b/qa/CMakeLists.txt @@ -5,5 +5,5 @@ endif() if(WITH_TESTS) include(AddCephTest) - add_tox_test(qa TOX_ENVS py3 flake8) + add_tox_test(qa TOX_ENVS py3 flake8 mypy) endif()