Bugzilla – Bug 6527
Rewrite Config module to use Config::General::Interpolated.pm - was Duplicate statements in gridshib-ca.conf silently override previous, should warn
Last modified: 2009-07-31 22:16:26
You need to log in before you can comment on or make changes to this bug.
A duplicate statement in gridshib-ca.conf will silently override a previous one. E.g., the second statement below is the only one that matters. OpenSSLCA = /usr/local/gridshib-ca-test/openssl-ca OpenSSLCA = $(GridShibCAConfDir)/openssl-ca I think the correct action here is to log a warning when this happens.
I think the right solution here is to rewrite the Config module to use Config::General::Interpolated.pm: http://search.cpan.org/~tlinden/Config-General-2.42/General/Interpolated.pm This will cause repeated values to be returned as an array which can be detected and warned about. It would also allow the file to contain sections which would organize things. The module also supports variable substitution allowing the GS-CA to shed a bunch of the current code.
(In reply to comment #1) > This will cause repeated values to be returned as an array which can be > detected and warned about. Actually MultiOptions can be disabled: -AllowMultiOptions => false Which will cause Config::General to raise an error: Config::General: Option "var" occurs more than once (level: 2, chunk 2)! at /tmp/p.pl line 4
(In reply to comment #1) > The module also supports variable substitution allowing the GS-CA to shed a > bunch of the current code. Unfortunately, it doesn't support the current GS-CA variable syntax. I.e. instead of $(FOO) it support ${FOO}, so this would entail a break of configuration file compatibility. I don't think this is a huge deal, but cause for pause.
Changes committed to CVS. Targetted for 0.6.0.
Ran into the following on one system trying to install Config::General via cpan. Solved by installing Test::More first. Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/run.t .. Can't locate Test/More.pm in @INC (@INC contains: /home/vwelch/.cpan/build/Config-General-2.42-Xxgk27/blib/lib /home/vwelch/.cpan/build/Config-General-2.42-Xxgk27/blib/arch /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl .) at t/run.t line 11.