diff options
Diffstat (limited to 'gitautodeploy/wrappers')
-rw-r--r-- | gitautodeploy/wrappers/git.py | 4 | ||||
-rw-r--r-- | gitautodeploy/wrappers/process.py | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gitautodeploy/wrappers/git.py b/gitautodeploy/wrappers/git.py index 1f7fe23..3b347d3 100644 --- a/gitautodeploy/wrappers/git.py +++ b/gitautodeploy/wrappers/git.py @@ -32,7 +32,7 @@ class GitWrapper(): # All commands need to success for command in commands: - res = ProcessWrapper().call(command, cwd=repo_config['path'], shell=True) + res = ProcessWrapper().call(command, cwd=repo_config['path'], shell=True, supressStderr=True) if res != 0: logger.error("Command '%s' failed with exit code %s" % (command, res)) @@ -76,7 +76,7 @@ class GitWrapper(): # All commands need to success for command in commands: - res = ProcessWrapper().call(command, cwd=repo_config['path'], shell=True) + res = ProcessWrapper().call(command, cwd=repo_config['path'], shell=True, supressStderr=True) if res != 0: logger.error("Command '%s' failed with exit code %s" % (command, res)) diff --git a/gitautodeploy/wrappers/process.py b/gitautodeploy/wrappers/process.py index 867e6cf..a810f23 100644 --- a/gitautodeploy/wrappers/process.py +++ b/gitautodeploy/wrappers/process.py @@ -9,7 +9,7 @@ class ProcessWrapper(): """Run command with arguments. Wait for command to complete. Sends output to logging module. The arguments are the same as for the Popen constructor.""" - + from subprocess import Popen, PIPE import logging logger = logging.getLogger() @@ -17,6 +17,10 @@ class ProcessWrapper(): kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE + if 'supressStderr' in kwargs: + supressStderr = kwargs['supressStderr'] + del kwargs['supressStderr'] + p = Popen(*popenargs, **kwargs) stdout, stderr = p.communicate() @@ -30,6 +34,9 @@ class ProcessWrapper(): if stderr: for line in stderr.strip().split("\n"): - logger.error(line) + if supressStderr: + logger.info(line) + else: + logger.error(line) return p.returncode
\ No newline at end of file |