Bug 6527 - Rewrite Config module to use Config::General::Interpolated.pm - was Duplicate statements in gridshib-ca.conf silently override previous, should warn
: Rewrite Config module to use Config::General::Interpolated.pm - was Duplicate...
Status: RESOLVED FIXED
: GridShib
GridShib-CA
: 0.5.1
: All All
: P3 normal
: ---
Assigned To:
:
:
:
: 6808
  Show dependency treegraph
 
Reported: 2008-11-06 10:59 by
Modified: 2009-07-31 22:16 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-11-06 10:59:14
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.
------- Comment #1 From 2009-04-17 21:30:44 -------
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.
------- Comment #2 From 2009-04-19 07:43:14 -------
(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
------- Comment #3 From 2009-04-19 07:52:13 -------
(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.
------- Comment #4 From 2009-04-25 21:07:30 -------
Changes committed to CVS. Targetted for 0.6.0.
------- Comment #5 From 2009-04-27 21:43:38 -------
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.