From: Dai Zhiwei Date: Fri, 8 Oct 2021 06:26:43 +0000 (+0800) Subject: qa/tasks: replace iterkeys() with keys() in Python 3 X-Git-Tag: v17.1.0~688^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=00e5e5d5cdb56b7e249ffc98aeb456c9ac1c5f48;p=ceph.git 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 --- 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