From a4a195b499f0a7a50292f2a1576341e633bd40da Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Thu, 20 Sep 2012 13:09:45 +0000 Subject: [PATCH] Remove a function that is not used Fixes bug 1053393 Change-Id: I7b7ae48d9e7bf34ce280a3aec53f1ec11fcd1158 --- quantum/common/utils.py | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/quantum/common/utils.py b/quantum/common/utils.py index d76c2ae09..313ee2af1 100644 --- a/quantum/common/utils.py +++ b/quantum/common/utils.py @@ -48,38 +48,6 @@ def boolize(subject): return subject -def _subprocess_setup(): - # Python installs a SIGPIPE handler by default. This is usually not what - # non-Python subprocesses expect. - signal.signal(signal.SIGPIPE, signal.SIG_DFL) - - -def execute(cmd, process_input=None, addl_env=None, check_exit_code=True): - logging.debug("Running cmd: %s", cmd) - env = os.environ.copy() - if addl_env: - env.update(addl_env) - obj = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - preexec_fn=_subprocess_setup, - env=env) - result = None - if process_input is not None: - result = obj.communicate(process_input) - else: - result = obj.communicate() - obj.stdin.close() - if obj.returncode: - logging.debug("Result was %s" % (obj.returncode)) - if check_exit_code and obj.returncode != 0: - (stdout, stderr) = result - raise ProcessExecutionError(exit_code=obj.returncode, - stdout=stdout, - stderr=stderr, - cmd=cmd) - return result - - def read_cached_file(filename, cache_info, reload_func=None): """Read from a file if it has been modified. -- 2.45.2