From 04ee7a8c315edc2d26917cef86a0de789da54a67 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 29 Sep 2022 08:05:02 -0400 Subject: [PATCH] Add '-l' to nodersync command --- confluent_client/bin/nodersync | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodersync b/confluent_client/bin/nodersync index 0e9cb435..ba95662c 100755 --- a/confluent_client/bin/nodersync +++ b/confluent_client/bin/nodersync @@ -46,6 +46,8 @@ def run(): help='Specify a maximum number of ' 'nodes to run rsync to, ' 'prompting if over the threshold') + argparser.add_option('-l', '--loginname', type='str', + help='Username to use when connecting, defaults to current user.') argparser.add_option('-f', '-c', '--count', type='int', default=168, help='Number of nodes to concurrently rsync') # among other things, FD_SETSIZE limits. Besides, spawning too many @@ -61,7 +63,10 @@ def run(): c = client.Command() cmdstr = ' '.join(args[:-1]) cmdstr = 'rsync -av --info=progress2 ' + cmdstr - cmdstr += ' {node}:' + targpath + if options.loginname: + cmdstr += ' {}@'.format(options.loginname) + '{node}:' + targpath + else: + cmdstr += ' {node}:' + targpath currprocs = 0 all = set([])