[Freeipa-devel] [PATCH] 0002 Add the culprit line when a configuration file has an incorrect format

Florence Blanc-Renaud frenaud at redhat.com
Fri Jun 3 07:45:50 UTC 2016


On 06/02/2016 07:18 PM, Martin Basti wrote:
>
>
>
> On 30.05.2016 18:11, Florence Blanc-Renaud wrote:
>>
>> Hi Martin,
>>
>> thanks for the review and the suggestion. Please find the updated 
>> patch attached.
>>
>> Flo.
>>
>> On 05/30/2016 11:00 AM, Martin Basti wrote:
>>>
>>>
>>>
>>> On 27.05.2016 11:35, Florence Blanc-Renaud wrote:
>>>>
>>>> Hi all,
>>>>
>>>> this patch adds information to the output of ipa-client-install 
>>>> when it fails due to invalid format in a configuration file:
>>>> ipa-client-install failing with SyntaxError: Syntax Error: Unknown 
>>>> line format
>>>>
>>>> Fixes: https://fedorahosted.org/freeipa/ticket/5811
>>>>
>>>> -- 
>>>> Florence Blanc-Renaud
>>>> Identity Management Team, Red Hat
>>>>
>>>>
>>> Thank you for your patch, I have just one nitpick. Can you please 
>>> reuse the original exception?
>>>
>>> -            curopts.append(self.parseLine(line))
>>> +            try:
>>> +                curopts.append(self.parseLine(line))
>>> +            except SyntaxError as e:
>>> +                raise SyntaxError('{error} in file {fname}: 
>>> [{line}]'.format(
>>> +                    error=e, fname=f.name, line=line))
>>>
>>> Martin^2
>>
>> -- 
>> Florence Blanc-Renaud
>> Identity Management Team, Red Hat
>
>
> We are almost there
>
> SyntaxError: Syntax Error: Unknown line format in file 
> /etc/nsswitch.conf: [sudoers     sss
> ]
>
> I don't like that extra newline, probably we should use line.rstrip() 
> to line, to remove any whitespaces on right side, I'm not sure about 
> left side, it probably should stay with whitespaces
>
> Martin^2

Hi Martin,
good catch. Please find the updated patch attached.

-- 
Florence Blanc-Renaud
Identity Management Team, Red Hat

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160603/47b708eb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-frenaud-0002-3-Add-the-culprit-line-when-a-configuration-file-has-a.patch
Type: text/x-patch
Size: 1414 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160603/47b708eb/attachment.bin>


More information about the Freeipa-devel mailing list