<p dir="ltr"><br>
On Jun 7, 2013 2:51 AM, "John Johansen" <<a href="mailto:john.johansen@canonical.com">john.johansen@canonical.com</a>> wrote:<br>
><br>
> On 06/06/2013 01:58 PM, Kshitij Gupta wrote:<br>
> > Hello,<br>
> ><br>
> > @John as suggested I used the configparser module and as it turns out we do have a problem with using it. Actually in the config files at present the default section is represented by an empty string (for e.g. in /etc/apparmor/easyprof.conf ), but configparser needs a none empty section header and hence raises an Error for the same.<br>
> ><br>
> > I think we should change the format and hence default section headers should be something like [DEFAULT] instead of an empty string.<br>
> ><br>
> Hrmm, no. easyprof.conf has already shipped, as such unless we have a really good reason to break backwards compatibility we don't.<br>
><br>
> Also easyprof.conf is not the config file you should be looking at, or at least not initially<br>
><br>
> genprof/logprof have used<br>
><br>
> logprof.conf and repository.cong<br>
><br>
Yes I did try the tools on logprof.conf for which both worked perfectly. However, I expected the tool to breakdown on the default section case which it did. There's no reason to have different parsers for different config files.</p>
<p dir="ltr">Maybe you could work the issue out in AppArmor3. :-)</p>
<p dir="ltr">> > Also, the order in which the config parser writes to output file is random (expected of a dictionary) and not sorted.<br>
> ><br>
> ><br>
> Does this matter? Generally our configs and policy have been declarative where order is irrelevant. However if config parser is not the right tool for the job don't use it. I have never actually used it, I just know it exists and uses a format that is close if not the same as what we where using so it is worth looking at. If after looking at it you decide it isn't the right tool, then just tell us so and don't use it.<br>
><br>
No, I too suppose the order does not matter. I was merely stating it. <br>
In my understanding I should work with the previous version, instead of the one using configparser and will use that, unless somebody gave a solution for the problem.</p>
<p dir="ltr">Regards,<br>
Kshitij Gupta<br>
</p>