From 00e5e5d5cdb56b7e249ffc98aeb456c9ac1c5f48 Mon Sep 17 00:00:00 2001 From: Dai Zhiwei Date: Fri, 8 Oct 2021 14:26:43 +0800 Subject: [PATCH] qa/tasks: replace iterkeys() with keys() in Python 3 Python 2.7 reached the end of its lifetime, the pr fixes teuthology task error in Python 3.x Fixes: https://tracker.ceph.com/issues/52878 Signed-off-by: Dai Zhiwei --- qa/tasks/netsplit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qa/tasks/netsplit.py b/qa/tasks/netsplit.py index b6614dc5061b4..0a9484a89a5c0 100644 --- a/qa/tasks/netsplit.py +++ b/qa/tasks/netsplit.py @@ -35,8 +35,8 @@ def disconnect(ctx, config): (ip1, _) = get_ip_and_ports(ctx, config[0]) (ip2, _) = get_ip_and_ports(ctx, config[1]) - (host1,) = ctx.cluster.only(config[0]).remotes.iterkeys() - (host2,) = ctx.cluster.only(config[1]).remotes.iterkeys() + (host1,) = ctx.cluster.only(config[0]).remotes.keys() + (host2,) = ctx.cluster.only(config[1]).remotes.keys() assert host1 is not None assert host2 is not None @@ -58,8 +58,8 @@ def reconnect(ctx, config): (ip1, _) = get_ip_and_ports(ctx, config[0]) (ip2, _) = get_ip_and_ports(ctx, config[1]) - (host1,) = ctx.cluster.only(config[0]).remotes.iterkeys() - (host2,) = ctx.cluster.only(config[1]).remotes.iterkeys() + (host1,) = ctx.cluster.only(config[0]).remotes.keys() + (host2,) = ctx.cluster.only(config[1]).remotes.keys() assert host1 is not None assert host2 is not None -- 2.39.5