diff --git a/confluent_client/bin/noderun b/confluent_client/bin/noderun index d859dc4b..df0d4a77 100755 --- a/confluent_client/bin/noderun +++ b/confluent_client/bin/noderun @@ -35,9 +35,12 @@ if path.startswith('/opt'): import confluent.client as client import confluent.sortutil as sortutil +devnull = None def run(): + global devnull + devnull = open(os.devnull, 'rb') argparser = optparse.OptionParser( usage="Usage: %prog [options] ", epilog="Expressions are the same as in attributes, e.g. " @@ -133,7 +136,7 @@ def run(): def run_cmdv(node, cmdv, all, pipedesc): try: nopen = subprocess.Popen( - cmdv, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmdv, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE) except OSError as e: if e.errno == 2: sys.stderr.write('{0}: Unable to find local executable file "{1}"'.format(node, cmdv[0])) diff --git a/confluent_client/bin/nodeshell b/confluent_client/bin/nodeshell index 06e1efc6..f22c1993 100755 --- a/confluent_client/bin/nodeshell +++ b/confluent_client/bin/nodeshell @@ -34,10 +34,11 @@ if path.startswith('/opt'): import confluent.client as client import confluent.sortutil as sortutil - +devnull = None def run(): - + global devnull + devnull = open(os.devnull, 'rb') argparser = optparse.OptionParser( usage="Usage: %prog [options] noderange commandexpression", epilog="Expressions are the same as in attributes, e.g. " @@ -172,7 +173,7 @@ def run(): def run_cmdv(node, cmdv, all, pipedesc): nopen = subprocess.Popen( - cmdv, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmdv, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE) pipedesc[nopen.stdout] = {'node': node, 'popen': nopen, 'type': 'stdout'} pipedesc[nopen.stderr] = {'node': node, 'popen': nopen,