-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn crudini into a Python library #19
Comments
While I would be very happy to accept patches for that if appropriate, To explore what a crudini library might provide,
So I suppose the context returned from a library would handle the locking.
Note the "shared" param would probably need to be explicitly specified |
Or better yet:
That is, implement a context manager if you want to manage lock acquisition/release. |
openstack-config seems to rely in crudini for manipulating configuration files. I'm working on a Python project for automation and troubleshooting in OpenStack and, as part of that project, I need to retrieve information from OpenStack configuration files. I think it makes sense to use crudini, as that's what it's used for installation and management and mentioned in OpenStack documents.
Problem is that crudini is a command-line tool and not a Python library. In order to retrieve data from OpenStack configuration files, I could spawn a subprocess calling /usr/bin/crudini but this is a very limited and weak interface mechanism (build a command-line, spawn crudini, parse standard output and exit code). I would prefer being able to "link" crudini as a library and, instead, using a Python native interface. For example, by calling a function or instantiating a class.
At the moment, the only functionality from crudini that I need is being able to retrieve key/value pairs (e.g. from section DEFAULT, retrieve the value for the report_interval key in file /etc/neutron/neutron.conf).
The text was updated successfully, but these errors were encountered: