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

Petr Viktorin pviktori at redhat.com
Thu May 22 16:24:36 UTC 2014


On 05/22/2014 04:06 PM, Nathaniel McCallum wrote:
> 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

Thanks!
Filed ticket: https://fedorahosted.org/freeipa/ticket/4351
Added to http://www.freeipa.org/page/V4_Minor_Enhancements instead of 
writing a design page
Added link to ticket and pushed to master: 
4d7351ef070176283d7626ae2501a4ad7acc093e

>
> 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.

Yeah, I couldn't use the common shortcut this time.

-- 
Petr³




More information about the Freeipa-devel mailing list