[Freeipa-devel] [PATCH] 309 make exception from ipautil.run() optional

Rob Crittenden rcritten at redhat.com
Tue Nov 17 19:58:52 UTC 2009


Jason Gerard DeRose wrote:
> On Wed, 2009-11-11 at 11:41 -0500, Rob Crittenden wrote:
>> Rob Crittenden wrote:
>>> There are probably occasions where a caller will want more control over 
>>> what happens when running a command fails. I've added an optional 
>>> argument to run where it will not raise an exception on errors.
>>>
>>> I've also added returncode to the tuple of things returned.
>>>
>>> rob
>> I forgot to include this additional change in the patch. When acked I'll 
>> add this bit too and commit it.
>>
>> --- a/ipaserver/install/httpinstance.py
>> +++ b/ipaserver/install/httpinstance.py
>> @@ -100,7 +100,7 @@ class HTTPInstance(service.Service):
>>           if selinux:
>>               try:
>>                   # returns e.g. "httpd_can_network_connect --> off"
>> -                (stdout, stderr) = ipautil.run(["/usr/sbin/getsebool",
>> +                (stdout, stderr, returncode) = 
>> ipautil.run(["/usr/sbin/getsebool",
>>  
>> "httpd_can_network_connect"])
>>                   self.backup_state("httpd_can_network_connect", 
>> stdout.split()[2])
>>               except:
> 
> ack.  It all looks fine to me, although I can't get this patch to apply.
> 

Ok, it is failing because it relies on a patch I didn't submit yet. I'll 
send that one out shortly and hold onto this one for now.

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/20091117/6afc5afc/attachment.bin>


More information about the Freeipa-devel mailing list