Skip to content

Commit 1fae9c5

Browse files
committed
Clush: use set instead of NodeSet for runtime progress info
1 parent 6df1ea4 commit 1fae9c5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/ClusterShell/CLI/Clush.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ def update(self):
416416
gwcnt = len(self.task.gateways)
417417
if gwcnt:
418418
# tree mode
419-
act_targets = NodeSet()
419+
act_targets = set()
420420
for gw, (chan, metaworkers) in self.task.gateways.items():
421-
act_targets.updaten(mw.gwtargets[gw].copy()
422-
for mw in metaworkers)
421+
for mw in metaworkers:
422+
act_targets.update(mw.gwtargets[gw])
423423
cnt = len(act_targets) + len(self.task._engine.clients()) - gwcnt
424424
gwinfo = ' gw %d' % gwcnt
425425
else:
@@ -598,15 +598,14 @@ def ttyloop(task, nodeset, timeout, display, remote, trytree):
598598
% (len(ns_reg), ns_reg, pending,
599599
len(gws), NodeSet._fromlist1(gws)))
600600
for gw, (chan, metaworkers) in task.gateways.items():
601-
act_targets = NodeSet()
601+
act_targets = set()
602602
for mw in metaworkers:
603-
# Compute active targets using updaten() from a copy of the
604-
# original sets as they might be frequently modified
605-
act_targets.updaten(mw.gwtargets[gw].copy())
603+
act_targets.update(mw.gwtargets[gw])
606604
if act_targets:
605+
act_tgt_ns = NodeSet.fromlist(act_targets)
607606
display.vprint_err(VERB_QUIET,
608607
"clush: [tree] in progress(%d) on %s: %s"
609-
% (len(act_targets), gw, act_targets))
608+
% (len(act_targets), gw, act_tgt_ns))
610609
else:
611610
cmdl = cmd.lower()
612611
try:

0 commit comments

Comments
 (0)