From d28aabd7e066d79d28e8fff46777e29d4b48ad59 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 17 Apr 2024 10:07:09 -0400 Subject: [PATCH] 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 --- .../cephadm/tests/test_remote_executables.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pybind/mgr/cephadm/tests/test_remote_executables.py b/src/pybind/mgr/cephadm/tests/test_remote_executables.py index a98f81a8df1ed..9d5bd458254c3 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"