From: Adam King Date: Wed, 17 Apr 2024 14:07:09 +0000 (-0400) Subject: mgr/cephadm: make remote_executables test able to handle ast.BinOp X-Git-Tag: v19.1.1~196^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3dbbf324f0e1717c2a95a252a0b7b34cb301e1fd;p=ceph.git mgr/cephadm: make remote_executables test able to handle ast.BinOp Was adding a line to serve.py that did if ((datetime_now() - t).total_seconds() < 60) and this was causing the remote_executables test to fail with ValueError: _names: unexpected type: where it seems the (datetime_now() - t) was resolving to an ast.BinOp node which had no case in _names. This patch makes it so the remote_executables test can also handle these BinOp nodes and the binary operations that could be within the node Signed-off-by: Adam King (cherry picked from commit d28aabd7e066d79d28e8fff46777e29d4b48ad59) --- diff --git a/src/pybind/mgr/cephadm/tests/test_remote_executables.py b/src/pybind/mgr/cephadm/tests/test_remote_executables.py index a98f81a8df1e..9d5bd458254c 100644 --- a/src/pybind/mgr/cephadm/tests/test_remote_executables.py +++ b/src/pybind/mgr/cephadm/tests/test_remote_executables.py @@ -102,6 +102,24 @@ def _names(node): return [f""] if isinstance(node, ast.Subscript): return [f""] + if isinstance(node, ast.BinOp): + return [f"