From e9372a4d344b2ed0c5a4be0b501414d2d528b925 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 11 Apr 2025 15:10:28 -0400 Subject: [PATCH] Provide means for nodeping to use original name on -s --- confluent_client/bin/nodeping | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodeping b/confluent_client/bin/nodeping index b9c45340..1140a6bd 100755 --- a/confluent_client/bin/nodeping +++ b/confluent_client/bin/nodeping @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2016-2017 Lenovo @@ -42,6 +42,8 @@ def run(): usage="Usage: %prog [options] noderange") argparser.add_option('-f', '-c', '--count', type='int', default=168, help='Number of commands to run at a time') + argparser.add_option('-o', '--origname', action='store_true', + help='Use original nodename in print out even if substituted') argparser.add_option('-s', '--substitutename', help='Use a different name other than the nodename for ping, with {}, it is the entire name evaluated as an expression, otherwise it is used as a suffix') # among other things, FD_SETSIZE limits. Besides, spawning too many @@ -83,7 +85,10 @@ def run(): cmdv = ['ping', '-c', '1', '-W', '1', pingnode] if currprocs < concurrentprocs: currprocs += 1 - run_cmdv(pingnode, cmdv, all, pipedesc) + if options.origname: + run_cmdv(node, cmdv, all, pipedesc) + else: + run_cmdv(pingnode, cmdv, all, pipedesc) else: pendingexecs.append((pingnode, cmdv)) if not all or exitcode: