Loading ccnode/utils.py +5 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ import os, sys, subprocess from socket import gethostname, gethostbyname from threading import Lock from logging import debug def enum(*sequential, **named): ''' Loading Loading @@ -188,16 +190,16 @@ class Exec(object): else: stdout = open(os.devnull, 'w') stderr = stdout ##print 'DBG>>>', ' '.join(cmd) debug('Exec.call: cmd=`%s`', ' '.join(cmd)) if input is not None: stdin = subprocess.PIPE ##print ' input=`%s`' % input debug('Exec.call: input=`%s`', input) else: stdin = None proc = subprocess.Popen(cmd, shell=shell, stdout=stdout, stderr=stderr, stdin=stdin) output = proc.communicate(input=input) ##print ' rc=`%d` out=`%s`' % (proc.returncode, output) debug('Exec.call: rc=`%d` out=`%s`', proc.returncode, output) return (proc.returncode, output) @staticmethod Loading Loading
ccnode/utils.py +5 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ import os, sys, subprocess from socket import gethostname, gethostbyname from threading import Lock from logging import debug def enum(*sequential, **named): ''' Loading Loading @@ -188,16 +190,16 @@ class Exec(object): else: stdout = open(os.devnull, 'w') stderr = stdout ##print 'DBG>>>', ' '.join(cmd) debug('Exec.call: cmd=`%s`', ' '.join(cmd)) if input is not None: stdin = subprocess.PIPE ##print ' input=`%s`' % input debug('Exec.call: input=`%s`', input) else: stdin = None proc = subprocess.Popen(cmd, shell=shell, stdout=stdout, stderr=stderr, stdin=stdin) output = proc.communicate(input=input) ##print ' rc=`%d` out=`%s`' % (proc.returncode, output) debug('Exec.call: rc=`%d` out=`%s`', proc.returncode, output) return (proc.returncode, output) @staticmethod Loading