summaryrefslogtreecommitdiffstats
path: root/ipapython/ipautil.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-07-17 15:55:36 +0200
committerAlexander Bokovoy <abokovoy@redhat.com>2013-07-18 17:16:49 +0300
commit6556b4fc4261f8051e13e0f7dd81481b78fa33d1 (patch)
tree654a71b0bec7add9e7fe736aa5a7f61efbbb09eb /ipapython/ipautil.py
parentb813a44df55bb2f42bce62ed274f744625ebb59c (diff)
downloadfreeipa-6556b4fc4261f8051e13e0f7dd81481b78fa33d1.tar.gz
freeipa-6556b4fc4261f8051e13e0f7dd81481b78fa33d1.tar.xz
freeipa-6556b4fc4261f8051e13e0f7dd81481b78fa33d1.zip
Gain information from ADad-work
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r--ipapython/ipautil.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 92569c3b4..e00f3ef3f 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -246,7 +246,7 @@ def shell_quote(string):
return "'" + string.replace("'", "'\\''") + "'"
def run(args, stdin=None, raiseonerr=True,
- nolog=(), env=None, capture_output=True, skip_output=False, cwd=None):
+ nolog=(), env=None, capture_output=True, skip_output=False, cwd=None, debug=False):
"""
Execute a command and return stdin, stdout and the process return code.
@@ -295,8 +295,9 @@ def run(args, stdin=None, raiseonerr=True,
p_err = subprocess.PIPE
arg_string = nolog_replace(' '.join(args), nolog)
- root_logger.debug('Starting external process')
- root_logger.debug('args=%s' % arg_string)
+ if debug:
+ root_logger.info('Starting external process')
+ root_logger.info('args=%s' % arg_string)
try:
p = subprocess.Popen(args, stdin=p_in, stdout=p_out, stderr=p_err,
@@ -314,7 +315,8 @@ def run(args, stdin=None, raiseonerr=True,
if skip_output:
p_out.close() # pylint: disable=E1103
- root_logger.debug('Process finished, return code=%s', p.returncode)
+ if debug:
+ root_logger.info('Process finished, return code=%s', p.returncode)
# The command and its output may include passwords that we don't want
# to log. Replace those.