[openstack-dev] Adding write capability in oslo-config

Thomas Goirand zigo at debian.org
Mon Mar 4 17:29:50 UTC 2013


Hi,

As much as I can see, the only thing which oslo-config does is *reading*
the config files for an openstack project. It doesn't seems that it is
possible to use the same API to actually write values.

As I do the Debian packaging, I would be happy to use oslo-config to be
able to read / write values in the different configuration files of
Openstack. I need to do that, for example to read, then set the
sql_connection DSN string in each package, as Openstack is integrated
with dbconfig-common in Debian.

The problem is that oslo-config doesn't currently provides a command
line tool. Though it would be really trivial to do:
oslo-config-get /etc/keystone/keystone.conf \
	DEFAULT admin_token

so that I could use that from my debian/*.config scripts.

But then I would also need in a debian/*.postinst script:
oslo-config-set /etc/keystone/keystone.conf \
	DEFAULT admin_token <password>

which isn't currently implemented at all in oslo-config. oslo-config
currently can only *read* .ini files, it can't actually *write*
directives in them.

While I currently need the above in my Debian packaging, I am quite sure
that it would be helpful for anyone willing to write automation tools to
deploy Openstack, so I am convinced it would be helpful for others to
add write functions in oslo-config.

Would anyone who worked on oslo-config have some time to write this?

Also, reading the code, it seems that the parser doesn't even implement
sections, which surprised me. Is this something planned? Or is it
specified that there will never be any 2 of the same directive in
different sections of a given configuration file?

If I find the time, I will try to hack such write functionality. Would
such patch be accepted?

Thoughts anyone?

Cheers,

Thomas



More information about the OpenStack-dev mailing list