[Openstack-devel] [openstack-dev] Debian packages for G3 available: please check build logs for unit test failures (Glance, Keystone and Nova)

Thomas Goirand zigo at debian.org
Tue Feb 26 18:46:31 UTC 2013


Hi Johannes, Chuck and James,

Previously, I was using some ugly shell script that was doing 100 lines
just to parse the .ini. Then, lo-lan-do wrote this:

> RET=$(python -c "import configobj
> config=configobj.ConfigObj('${FILE}')
> print config['${SECTION}']['${DIRECTIVE}']")

But the problem, as you may know, is that it's not compatible with the
.ini files of openstack which includes directives like this:

/:meta

This finally went even more in a bad way with this bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=700620

That's because Essex is is wheezy with "unpatched" .ini files (sic!),
which crashes configobj.

Instead of this, I thought about embedding the python code of
oslo-config in my Debian maintainer scripts, as this package has a .ini
parser designed for Openstack.

Johannes, could you help me, and show me an example python code, using
oslo-config, so that my shell script gets the value of  ${DIRECTIVE} in
${RET}? Thanks in advance.

I believe I will *have* to embed some python and not use the packaged
version rather than using it. That's because I need the above in the
debian/*.config scripts of my packages, which is executed by debconf
*before* any package is installed. And I would like to avoid a
pre-depends on oslo-config in my packages (which would break the flow of
debconf).

It seems that in this case, I would need a built-using to be able to
embed your code into my shell script.

Do you imagine oslo-config become more complex in the future? (I would
be pleased if it stayed minimalistic and easy to embed in a .sh script).

What's your thoughts as the upstream author?

Also, to everyone else using / packaging openstack (James? Chuck?), how
would you feel ok with embedding oslo-config python code into all the
debian/*.config maintainer scripts?

Embedding code is often considered a bad practice, but at the same time,
adding a pre-depends will inevitably break the flow of debconf, so I am
really unsure which of the 2 I should use. I tried writing my own stuff
in shell script, and it was really crap. So any opinion would be welcome.

Cheers,

Thomas Goirand (zigo)



More information about the Openstack-devel mailing list