ginger-dev-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ginger-dev-list] about using confparse VS python configparser to parse


From: Daniel Henrique Barboza
Subject: [Ginger-dev-list] about using confparse VS python configparser to parse net scripts
Date: Mon, 19 Oct 2015 14:42:22 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Hi,

I've been discussing this in private with Jayavardhan and I thought it would be better to push the discussion to the ML.

Jayavardhan asked me if it was ok to use https://code.google.com/p/confparse/ to parse the network scripts. The idea is that the default python package, ConfigParser (https://docs.python.org/2/library/configparser.html) does not work well with files that are section-less, which happens to be the case of Linux network scripts.

Checking out confparser I've noticed two downsides:

- license. It uses LGPLv3 while the rest of the plug-ins/WoK uses LGPLv2. It is not *that* big of a deal - we would need to move Ginger, Kimchi, Wok and the future Ginger-base to LGPL v3 as well - but it is extra work.

- support. As far as I've noticed, the project isn't being supported anymore. There are 2 open issues in the old repo at code.google.com and the latest commit in github is from Feb 22 2013. I am not sure if we can rely in this library to release a product.


My suggestion is to use the default python library, ConfigParser, and workaround its limitations to read the network files. Here's a solution I've found in the web of the section-less config file:


http://stackoverflow.com/questions/2885190/using-pythons-configparser-to-read-a-file-without-section-name


Let me know your comments/thoughts and if you're having problems parsing the network scripts and init files.


Daniel







reply via email to

[Prev in Thread] Current Thread [Next in Thread]