[Freeipa-devel] [PATCH 0069] ipa-nis-manage enable: change service name from 'portmap' to 'rpcbind'
Martin Basti
mbasti at redhat.com
Tue May 10 12:26:58 UTC 2016
On 10.05.2016 14:13, Gabe Alford wrote:
> On Tue, May 10, 2016 at 2:00 AM, Martin Basti <mbasti at redhat.com
> <mailto:mbasti at redhat.com>> wrote:
>
>
>
> On 04.05.2016 15:14, Gabe Alford wrote:
>> On Tue, May 3, 2016 at 11:17 PM, Abhijeet Kasurde
>> <akasurde at redhat.com <mailto:akasurde at redhat.com>> wrote:
>>
>> Hi Gabe,
>>
>> I am wondering, how are we handling "CalledProcessError"
>> exception ?
>>
>>
>> I am not sure 100% what you are asking, but from what I
>> understand, the "CalledProcessError" exception is when a process
>> returns a non-zero exit status.
>> However when running 'ipa-nis-manage enable', an exception is
>> never hit even if portmap is not installed, hence portmap always
>> being enabled.
>>
>> So it seems that if the process is not installed,
>> "CalledProcessError" doesn't catch an error.
>>
>> Gabe
> Hello,
>
> portmap.enable() may raise the "CalledProcessError" in case that
> systemct enable failed and we should catch this exception and
> handle it in the same way as it is done now. i.e catch that
> exception and set proper return state.
>
> Martin^2
>
>
> Shouldn't "CalledProcessError" raise an exception in this case? In my
> testing, it doesn't seem to raise an exception when the service does
> not even exist on the system.
>
> Gabe
>
You are right, there is try-except-pass, so no exception can be raised
def __enable(self, instance_name=""):
try:
ipautil.run([paths.SYSTEMCTL,"enable",
self.service_instance(instance_name)])
except ipautil.CalledProcessError:
pass
Martin
>
>
>> On 05/04/2016 09:17 AM, Gabe Alford wrote:
>>> Hello,
>>>
>>> Fix for https://fedorahosted.org/freeipa/ticket/5857
>>>
>>> Thanks,
>>>
>>> Gabe
>>>
>>>
>> Thanks,
>> Abhijeet Kasurde
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160510/26d74781/attachment.htm>
More information about the Freeipa-devel
mailing list