[Freeipa-devel] [PATCH] 0550 ipalib.cli: Add filename argument to ipa console

Nathaniel McCallum npmccallum at redhat.com
Thu May 22 14:06:46 UTC 2014


On Thu, 2014-05-22 at 15:07 +0200, Petr Viktorin wrote:
> Hello,
> I find the `ipa console` command quite useful for testing, and it's 
> bothered me that it can't execute a script. Fixing this helps me. Would 
> it help anyone else?
> 
> This would need a ticket + design doc before it's pushed.
> 
> 
> Compare:
> $ (echo 'print 1'; echo 'print 2') | ipa console
> (Custom IPA interactive Python console)
>  >>> 1
>  >>> 2
> 
>  >>> [no newline]
> 
> $ ipa console <(echo 'print 1'; echo 'print 2')
> 1
> 2

Looks helpful to me. ACK

Also, FTR, at first I thought it looked weird to have the open() outside
of the with statement. But this is because you only want to catch the
IOError during the open() operation. So the behavior in this patch is
correct.

Nathaniel




More information about the Freeipa-devel mailing list