Loading cloudcontrol/node/utils.py +17 −0 Original line number Diff line number Diff line import subprocess def and_(iter): """Do an and logic condition over the iterable element. Loading @@ -8,3 +11,17 @@ def and_(iter): return False return True def subproc_call(args, stdin=None): """ :param args: arguments for subprocess call :param stdin: stdin data as string """ proc = subprocess.Popen(args, bufsize=4096, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result, _ = proc.communicate(stdin) if proc.returncode != 0: raise subprocess.CalledProcessError(proc.returncode, 'Error while executing command') return result Loading
cloudcontrol/node/utils.py +17 −0 Original line number Diff line number Diff line import subprocess def and_(iter): """Do an and logic condition over the iterable element. Loading @@ -8,3 +11,17 @@ def and_(iter): return False return True def subproc_call(args, stdin=None): """ :param args: arguments for subprocess call :param stdin: stdin data as string """ proc = subprocess.Popen(args, bufsize=4096, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result, _ = proc.communicate(stdin) if proc.returncode != 0: raise subprocess.CalledProcessError(proc.returncode, 'Error while executing command') return result