[Freeipa-devel] why doesn't ipapython.ipautil.run() log what it's running?

Rob Crittenden rcritten at redhat.com
Tue Oct 13 18:51:06 UTC 2009


John Dennis wrote:
> On 10/13/2009 02:25 PM, Rob Crittenden wrote:
>> John Dennis wrote:
>>> Is there a reason why the run command (ipapython.ipautil.run()) does
>>> not log what command it's running? It logs the stdout and stderr
>>> output of the command (but without indicating what the log output is,
>>> so a lot of time it just shows up as a blank line if there was no
>>> output). Shouldn't it do something like this:
>>>
>>> logging.info("args=%s" % " ".join(args))
>>> logging.info("stdout=%s" % stdout)
>>> logging.info("stderr=%s" % stderr)
>>>
>>> instead of:
>>>
>>> logging.info(stdout)
>>> logging.info(stderr)
>>>
>>> Without knowing what was run and what it's arguments were the stdout
>>> and stderr messages are almost useless.
>>>
>>
>> Guess it never came up before. Seems to make sense to be more explicit.
>>
> 
> Well, it occurred to me that one reason might be because the command 
> might contain sensitive information such as passwords. I did notice that 
> some code will do a logging.debug(args) before calling ipautil.run(), 
> it's not clear to me why this pattern exists.
> 
> Also, for some reason with ipa-server-install *no* debug messages are 
> appearing even though standard_logging_setup() is being called which 
> sets the log level to debug. I'm investigating the reason now (perhaps 
> using the wrong logger instance?)
> 

If I were to guess I'd look at ipalib, I think it creates its own 
loggers. Perhaps it is redirecting them.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20091013/a6d16efe/attachment.bin>


More information about the Freeipa-devel mailing list