File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ Data type: `String[1]`
420420
421421group owner of dotfile
422422
423- Default value: ` 'root' `
423+ Default value: ` getvar('python::params::group') `
424424
425425##### <a name =" -python--dotfile--config " ></a >` config `
426426
Original file line number Diff line number Diff line change 2626 Enum['absent', 'present'] $ensure = ' present' ,
2727 Stdlib::Absolutepath $filename = $title,
2828 String[1] $owner = ' root' ,
29- String[1] $group = ' root ' ,
29+ String[1] $group = getvar( ' python::params::group ' ) ,
3030 Stdlib::Filemode $mode = ' 0644' ,
3131 Hash $config = {},
3232) {
Original file line number Diff line number Diff line change 99 facts
1010 end
1111
12+ let ( :root_group ) do
13+ if facts [ :os ] [ 'family' ] == 'FreeBSD'
14+ 'wheel'
15+ else
16+ 'root'
17+ end
18+ end
19+
20+ let ( :pre_condition ) { 'include python' }
21+
1222 describe 'dotfile as' do
1323 context 'fails with empty string filename' do
1424 let ( :title ) { '' }
3242 context 'succeeds with filename in a non-existing path' do
3343 let ( :title ) { '/home/someuser/.pip/pip.conf' }
3444
35- it { is_expected . to contain_exec ( 'create /home/someuser/.pip/pip.conf\'s parent dir' ) . with_command ( ' install -o root -g root -d /home/someuser/.pip' ) }
45+ it { is_expected . to contain_exec ( 'create /home/someuser/.pip/pip.conf\'s parent dir' ) . with_command ( " install -o root -g #{ root_group } -d /home/someuser/.pip" ) }
3646 it { is_expected . to contain_file ( '/home/someuser/.pip/pip.conf' ) . with_mode ( '0644' ) }
3747 end
3848
3949 context 'succeeds when set owner' do
4050 let ( :title ) { '/home/someuser/.pip/pip.conf' }
4151 let ( :params ) { { owner : 'someuser' } }
4252
43- it { is_expected . to contain_exec ( 'create /home/someuser/.pip/pip.conf\'s parent dir' ) . with_command ( ' install -o someuser -g root -d /home/someuser/.pip' ) }
53+ it { is_expected . to contain_exec ( 'create /home/someuser/.pip/pip.conf\'s parent dir' ) . with_command ( " install -o someuser -g #{ root_group } -d /home/someuser/.pip" ) }
4454 it { is_expected . to contain_file ( '/home/someuser/.pip/pip.conf' ) . with_owner ( 'someuser' ) }
4555 end
4656
You can’t perform that action at this time.
0 commit comments