From b849bb22b0de9ba2e1e646722db29f46684589ad Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Sun, 8 Sep 2024 08:35:08 -0400 Subject: [PATCH] tests/ccmcluster.py: make parse_cluster_status ignore lines that does not match It could fail with following error: ``` def parse_cluster_status(self, stdout): """ Output: Cluster: 'CCMCluster-reloc' --------------------------- node1: UP return: [(node1, UP)] """ nodes_status = [] for line in stdout.split("\n")[2:]: > node, status = line.split(":") E ValueError: not enough values to unpack (expected 2, got 1) ``` --- tests/ccmcluster.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ccmcluster.py b/tests/ccmcluster.py index 162b3a7c..cf3eae62 100644 --- a/tests/ccmcluster.py +++ b/tests/ccmcluster.py @@ -113,7 +113,10 @@ def parse_cluster_status(self, stdout): """ nodes_status = [] for line in stdout.split("\n")[2:]: - node, status = line.split(":") + chunks = line.split(":") + if len(chunks) != 2: + continue + node, status = chunks nodes_status.append((node.strip(), status.strip())) return nodes_status