Hi Thomas Thomas Goirand <z...@debian.org> writes:
> On 12/19/2013 03:43 AM, Gaudenz Steinlin wrote: >>> This is some remaining from before I restarted working on the packaging >>> of OpenStack, and a feature which I just didn't touch. Each time I see >>> it, I think I should kill this functionality. Would you agree (and the >>> rest of the packaging team) that it's useless, since Debian has all the >>> needed tools to do that? >>> >>> If nobody complains about it, I'll kill this thing completely, and will >>> do the same for Nova. >> >> I'm not exactly sure what you are refering here with "this thing". If >> you mean the part that you can enable service in /etc/default/* files, >> then I completely agree. I just did not mention this because it's not >> really part of the bug, but IMO this is a bad way to control if a >> service is started or not, there are much better ways to not start a >> service (ie runlevels) and at the same time keeping the possiblity of >> starting it from the command line with the normal init script. >> >> So I'm very much in favor of this. But this does only work around this >> instance of the bug and not solve the deeper issue which is somewhere >> inside the pile of shell code in openstack-pkg-tools. > > The problem doesn't lie at all in openstack-pkg-tools, which in itself > is policy compliant. Read what it does if you aren't convinced. Nowhere did I say that openstack-pkg-tools is not policy compliant. The part that concerns openstack-pkg-tools is not about policy compliance, but just a simple bug. As I already wrote in the first mail, I read the code. The code currently in cinder-common.config.in (which will be removed) tries to do the right thing by useing pkgos_read_config, but inside this function (which uses pkgos_inifile for the low level work) it files to correctly read the value from the file. That's the underlying bug that should also be fixed. I just went back and made a small test case. The script is attached to this mail: gaudenz@meteor:~/tmp$ ./test.sh Testing pkgos_inifile WITHOUT section Return value: NOT_FOUND Expected return value: false Testing pkgos_inifile WITH section Return value: false Expected return value: false I guess the bug is somewhere in the handling of the NO_SECTION parameter to pkgos_inifile. Gaudenz
#!/bin/sh . /usr/share/openstack-pkg-tools/pkgos_func TESTFILE_NO_SECTION=$(tempfile) TESTFILE_WITH_SECTION=$(tempfile) CINDER_ENABLE="false" echo "# defaults file for cinder daemons # start cinder daemons from init.d script? # only allowed values are \"true\" and \"false\", # any change to this file will be reset on upgrades. CINDER_ENABLE=${CINDER_ENABLE}" > ${TESTFILE_NO_SECTION} echo "# defaults file for cinder daemons [test-section] # start cinder daemons from init.d script? # only allowed values are \"true\" and \"false\", # any change to this file will be reset on upgrades. CINDER_ENABLE=${CINDER_ENABLE}" > ${TESTFILE_WITH_SECTION} echo "Testing pkgos_inifile WITHOUT section" pkgos_inifile get ${TESTFILE_NO_SECTION} NO_SECTION CINDER_ENABLE echo "Return value: ${RET}" echo "Expected return value: ${CINDER_ENABLE}" echo echo "Testing pkgos_inifile WITH section" pkgos_inifile get ${TESTFILE_WITH_SECTION} test-section CINDER_ENABLE echo "Return value: ${RET}" echo "Expected return value: ${CINDER_ENABLE}" rm ${TESTFILE_NO_SECTION} rm ${TESTFILE_WITH_SECTION}
-- Ever tried. Ever failed. No matter. Try again. Fail again. Fail better. ~ Samuel Beckett ~