Codebase list libconfig-model-backend-augeas-perl / upstream/0.122
New upstream version 0.122 Dominique Dumont 6 years ago
10 changed file(s) with 130 addition(s) and 130 deletion(s). Raw diff Collapse all Expand all
3434 configure_requires => { 'Module::Build' => '0.36' },
3535 requires => {
3636 'Log::Log4perl' => '1.11', # for TRACE log level
37 'Exception::Class' => 0,
3837 'Config::Augeas' => '0.303',
39 'Config::Model' => '2.034',
38 'Config::Model' => '2.111',
4039 'Mouse' => 0,
41
4240 },
4341 build_requires => {
44 'Test::More' => 0,
45 'Test::Exception' => 0,
46 'Test::Differences' => 0,
47 'Test::Warn' => '0.11', # tests fail with 0.08
48 'version' => '0.77'
49 },
42 'Config::Model::Itself' => '2.012', # for t/model_extension.t
43 'Test::More' => 0,
44 'Test::Exception' => 0,
45 'Test::Differences' => 0,
46 'Test::Warn' => '0.11', # tests fail with 0.08
47 'version' => '0.77'
48 },
5049
5150 # cleanup required by t/augeas_backend.t
5251 add_to_cleanup => [qw/wr_root r_root/],
0 2017-10-03 Dominique Dumont <domi.dumont@free.fr> v0.122
1
2 * Build.PL: require Config::Model::Itself 2.012 for tests
3 * Build.PL: remove obsolete dependency on Exception::Class
4
5 2017-10-01 Dominique Dumont <domi.dumont@free.fr> v0.121
6
7 * changed test backend specification to use rw_config instead of
8 read_config following the deprecation done in Config::Model 2.111
9 * Renamed meta model extension to follow the changes done in
10 Config::Model::Itself 2.012
11
012 2017-05-14 Dominique Dumont <domi.dumont@free.fr> v0.120
113
214 * tweak test to cope with '.' removal from @INC
5567 * require Config::Model 1.255
5668
5769
58 2010-12-13 Dominique Dumont <dominique.dumont@hp.com> v0.109
70 2010-12-13 Dominique Dumont <domi.dumont@free.fr> v0.109
5971
6072 * updated tests to work with Config::Model 1.236
6173 (fix Ubuntu bug #749108)
6274
63 2010-12-13 Dominique Dumont <dominique.dumont@hp.com> v0.108
75 2010-12-13 Dominique Dumont <domi.dumont@free.fr> v0.108
6476
6577 * updated tests to work with Config::Model 1.207
6678 * C::M::B::Augeas: synopsis is now a model snippet
67
68 2009-05-29 Dominique Dumont <dominique.dumont@hp.com> v0.107
79
80 2009-05-29 Dominique Dumont <domi.dumont@free.fr> v0.107
6981
7082 * lib/Config/Model/Backend/Augeas.pm (all): Use Log::Log4perl for
7183 trace with Data::Read and Data::Write categories
7284
73 2009-05-28 Dominique Dumont <dominique.dumont@hp.com>
85 2009-05-28 Dominique Dumont <domi.dumont@free.fr>
7486
7587 * lib/Config/Model/Backend/Augeas.pm: replaced obsolete
7688 config_file parameter with file (Config::Model 0.636)
7789 (all): ignore Augeas #comment nodes
7890
79 2009-03-31 Dominique Dumont <dominique.dumont@hp.com> v0.106
91 2009-03-31 Dominique Dumont <domi.dumont@free.fr> v0.106
8092
8193 * t/*.t: fixed tests that broke with Config::Model 0.634
8294 (Fixes Debian bug #521968)
8395
84 2009-01-28 Dominique Dumont <dominique.dumont@hp.com> v0.105
96 2009-01-28 Dominique Dumont <domi.dumont@free.fr> v0.105
8597
8698 * t/augeas*.t: Sometimes the Augeas locale bug workaround also
8799 needs LC_ALL=C.
88100
89 2009-01-27 Dominique Dumont <dominique.dumont@hp.com> v0.104
101 2009-01-27 Dominique Dumont <domi.dumont@free.fr> v0.104
90102
91103 * lib/Config/Model/Backend/Augeas.pm (write): Do no create
92104 directory to store config files. Creating dir for file is Augeas
98110 tests can be run on amd64 arch. The workaround re-run tests with
99111 LANG=C environment
100112
101 2009-01-19 Dominique Dumont <dominique.dumont@hp.com> v0.102
113 2009-01-19 Dominique Dumont <domi.dumont@free.fr> v0.102
102114
103115 * lib/Config/Model/Backend/Augeas.pm: Lots of improvement to deal
104116 with sshd_config lenses
105117
106 2008-11-16 Domi <domi@bilbo.maison>
118 2008-11-16 Dominique Dumont <domi.dumont@free.fr>
107119
108120 * lib/Config/Model/Backend/Augeas.pm (write): Fixed a bug that
109121 prevented to write through Augeas even if read through Augeas was
110122 not done.
111123
112 2008-11-13 Dominique Dumont <dominique.dumont@hp.com> v0.101
124 2008-11-13 Dominique Dumont <domi.dumont@free.fr> v0.101
113125
114126 * lib/Config/Model/Backend/Augeas.pm: First version
115
116127
128
22 Build.PL
33 ChangeLog
44 lib/Config/Model/Backend/Augeas.pm
5 lib/Config/Model/models/Itself/ConfigWR.d/augeas-backend.pl
5 lib/Config/Model/models/Itself/ConfigReadWrite.d/augeas-backend.pl
66 MANIFEST This list of files
77 META.json
88 META.yml
33 "Dominique Dumont (ddumont at cpan dot org)"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "Module::Build version 0.422",
6 "generated_by" : "Module::Build version 0.4224",
77 "license" : [
88 "lgpl_2_1"
99 ],
1515 "prereqs" : {
1616 "build" : {
1717 "requires" : {
18 "Config::Model::Itself" : "2.012",
1819 "Test::Differences" : "0",
1920 "Test::Exception" : "0",
2021 "Test::More" : "0",
3031 "runtime" : {
3132 "requires" : {
3233 "Config::Augeas" : "0.303",
33 "Config::Model" : "2.034",
34 "Exception::Class" : "0",
34 "Config::Model" : "2.111",
3535 "Log::Log4perl" : "1.11",
3636 "Mouse" : "0"
3737 }
4040 "provides" : {
4141 "Config::Model::Backend::Augeas" : {
4242 "file" : "lib/Config/Model/Backend/Augeas.pm",
43 "version" : "0.120"
43 "version" : "0.122"
4444 }
4545 },
4646 "release_status" : "stable",
4949 "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt"
5050 ]
5151 },
52 "version" : "0.120",
53 "x_serialization_backend" : "JSON::PP version 2.27300_01"
52 "version" : "0.122",
53 "x_serialization_backend" : "JSON::PP version 2.27400_02"
5454 }
22 author:
33 - 'Dominique Dumont (ddumont at cpan dot org)'
44 build_requires:
5 Config::Model::Itself: '2.012'
56 Test::Differences: '0'
67 Test::Exception: '0'
78 Test::More: '0'
1011 configure_requires:
1112 Module::Build: '0.36'
1213 dynamic_config: 1
13 generated_by: 'Module::Build version 0.422, CPAN::Meta::Converter version 2.150005'
14 generated_by: 'Module::Build version 0.4224, CPAN::Meta::Converter version 2.150010'
1415 license: lgpl
1516 meta-spec:
1617 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1920 provides:
2021 Config::Model::Backend::Augeas:
2122 file: lib/Config/Model/Backend/Augeas.pm
22 version: '0.120'
23 version: '0.122'
2324 requires:
2425 Config::Augeas: '0.303'
25 Config::Model: '2.034'
26 Exception::Class: '0'
26 Config::Model: '2.111'
2727 Log::Log4perl: '1.11'
2828 Mouse: '0'
2929 resources:
3030 license: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
31 version: '0.120'
31 version: '0.122'
3232 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
3131 eval { require Config::Augeas; };
3232 $has_augeas = 0 if $@;
3333
34 our $VERSION = '0.120';
34 our $VERSION = '0.122';
3535
3636 my $logger = get_logger('Backend::Augeas');
3737
0 [
1 [
2 name => "Itself::ConfigReadWrite",
3
4 'element' => [
5
6 'backend' => {
7 choice => [qw/Augeas/],
8 help => {
9 augeas => "Experimental backend with RedHat's Augeas library. See http://augeas.net for details",
10 }
11 },
12
13 'save' => {
14 type => 'leaf',
15 value_type => 'enum',
16 choice => [qw/backup newfile/],
17 level => 'hidden',
18 description =>
19 'Specify how to save the configuration file. Either create a newfile (with extension .augnew, and do not overwrite the original file) or move the original file into a backup file (.augsave extension). Configuration files are overwritten by default',
20 warp => {
21 follow => '- backend',
22 rules => [ Augeas => { level => 'normal', } ],
23 }
24 },
25
26 'set_in' => {
27 type => 'leaf',
28 value_type => 'reference',
29 refer_to => '- - element',
30 level => 'hidden',
31 description =>
32 'Sometimes, the structure of a file loaded by Augeas starts directly with a list of items. For instance, /etc/hosts structure starts with a list of lines that specify hosts and IP addresses. This parameter specifies an element name in Config::Model root class that will hold the configuration data retrieved by Augeas',
33 warp => {
34 follow => '- backend',
35 rules => [ Augeas => { level => 'normal', } ],
36 }
37 },
38 'sequential_lens' => {
39 type => 'list',
40 level => 'hidden',
41 cargo => {
42 type => 'leaf',
43 value_type => 'uniline',
44 },
45 warp => {
46 follow => { b => '- backend' },
47 rules => [ '$b eq "Augeas"' => { level => 'normal', } ],
48 },
49 description =>
50 'List of hash or list Augeas lenses where value are stored in sequential Augeas nodes. See Config::Model::Backend::Augeas for details.',
51 },
52 ],
53
54 ],
55
56 ];
+0
-57
lib/Config/Model/models/Itself/ConfigWR.d/augeas-backend.pl less more
0 [
1 [
2 name => "Itself::ConfigWR",
3
4 'element' => [
5
6 'backend' => {
7 choice => [qw/Augeas/],
8 help => {
9 augeas => "Experimental backend with RedHat's Augeas library. See http://augeas.net for details",
10 }
11 },
12
13 'save' => {
14 type => 'leaf',
15 value_type => 'enum',
16 choice => [qw/backup newfile/],
17 level => 'hidden',
18 description =>
19 'Specify how to save the configuration file. Either create a newfile (with extension .augnew, and do not overwrite the original file) or move the original file into a backup file (.augsave extension). Configuration files are overwritten by default',
20 warp => {
21 follow => '- backend',
22 rules => [ Augeas => { level => 'normal', } ],
23 }
24 },
25
26 'set_in' => {
27 type => 'leaf',
28 value_type => 'reference',
29 refer_to => '- - element',
30 level => 'hidden',
31 description =>
32 'Sometimes, the structure of a file loaded by Augeas starts directly with a list of items. For instance, /etc/hosts structure starts with a list of lines that specify hosts and IP addresses. This parameter specifies an element name in Config::Model root class that will hold the configuration data retrieved by Augeas',
33 warp => {
34 follow => '- backend',
35 rules => [ Augeas => { level => 'normal', } ],
36 }
37 },
38 'sequential_lens' => {
39 type => 'list',
40 level => 'hidden',
41 cargo => {
42 type => 'leaf',
43 value_type => 'uniline',
44 },
45 warp => {
46 follow => { b => '- backend' },
47 rules => [ '$b eq "Augeas"' => { level => 'normal', } ],
48 },
49 description =>
50 'List of hash or list Augeas lenses where value are stored in sequential Augeas nodes. See Config::Model::Backend::Augeas for details.',
51 },
52 ],
53
54 ],
55
56 ];
1818 use ExtUtils::testlib;
1919 use Log::Log4perl qw(:easy :levels) ;
2020 use Config::Model ;
21 use Config::Model::Itself 2.012;
2122
2223 no warnings qw(once);
23
24 eval { require Config::Model::Itself ;} ;
25 if ( $@ ) {
26 plan skip_all => 'Config::Model::Itself is not installed';
27 }
28 else {
29 plan tests => 3;
30 }
3124
3225 my $arg = shift || '';
3326 my ($log,$show) = (0) x 2 ;
6053
6154 my $meta_root = $meta_inst->config_root ;
6255
63 my %ssh_model;
56 my %ssh_model ;
57
58 # avoid unordered hash warning
59 $ssh_model{class}{__order} = ['MasterModel::SshdWithAugeas'];
6460
6561 $ssh_model{class}{'MasterModel::SshdWithAugeas'} = {
6662
67 'read_config' => [
68 {
69 backend => 'Augeas',
70 config_dir => '/etc/ssh',
71 file => 'sshd_config',
72 sequential_lens => [qw/HostKey Subsystem Match/],
73 },
74 {
75 backend => 'perl_file',
76 config_dir => '/etc/ssh',
77 auto_create => 1,
78 },
79 ],
63 'rw_config' => {
64 backend => 'Augeas',
65 # commentnfig_dir => '/etc/ssh',
66 file => 'sshd_config',
67 sequential_lens => [qw/HostKey Subsystem Match/],
68 },
8069
8170 element => [
8271 'AcceptEnv',
120109
121110 # kind of not necessary since load_data aboce will fail if the model extension is
122111 # not loaded
123 my $backend = $meta_root->grab("class:MasterModel::SshdWithAugeas read_config:0 backend") ;
112 my $backend = $meta_root->grab("class:MasterModel::SshdWithAugeas rw_config backend") ;
124113 like(
125114 join( ',', $backend->get_choice),
126115 qr/Augeas/,
127116 "test that augeas backend is part of backend choice"
128117 ) ;
129118
119 done_testing();
1616 (
1717 name => 'Hosts',
1818
19 read_config => [ { backend => 'augeas',
20 config_dir => '/etc/',
21 file => 'hosts',
22 set_in => 'record',
23 save => 'backup',
24 #sequential_lens => ['record'],
25 },
26 ],
19 rw_config => {
20 backend => 'augeas',
21 config_dir => '/etc/',
22 file => 'hosts',
23 set_in => 'record',
24 save => 'backup',
25 #sequential_lens => ['record'],
26 },
2727
2828 element => [
2929 record => { type => 'list',
3838 (
3939 name => 'Sshd',
4040
41 'read_config'
42 => [ { backend => 'augeas',
43 config_dir => '/etc/ssh/',
44 file => 'sshd_config',
45 save => 'backup',
46 sequential_lens => [qw/HostKey Subsystem Match/],
47 },
48 ],
41 'rw_config' => {
42 backend => 'augeas',
43 config_dir => '/etc/ssh/',
44 file => 'sshd_config',
45 save => 'backup',
46 sequential_lens => [qw/HostKey Subsystem Match/],
47 },
4948
5049 element => [
5150 'AcceptEnv',