Skip to content

Commit cf4737b

Browse files
committed
sources format and ensure => absent fails
```puppet apt::source{ ensure => absent, source_format => sources, ``` produces a compile error every time. ``` Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Apt::Setting[sources-my_source]: parameter 'content' expects a value of type Undef or String[1], got String (file: /home/steve/GIT/puppetlabs-apt/spec/fixtures/modules/apt/manifests/source.pp, line: 363) on node legion.lan ```
1 parent 73fc966 commit cf4737b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

manifests/source.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@
348348
)
349349
}
350350
'absent': {
351-
$header = undef
352-
$source_content = undef
351+
$header = '# no content not permitted, ignored for absent case'
352+
$source_content = '# not content not permitted, ignored for absent case'
353353
}
354354
default: {
355355
fail('Unexpected value for $ensure parameter.')

spec/defines/source_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,20 @@
455455
it { is_expected.to contain_apt__setting("sources-#{title}").with_notify_update(true) }
456456
end
457457

458+
context 'absent deb822 source' do
459+
let :params do
460+
super().merge(
461+
{
462+
ensure: 'absent',
463+
location: ['http://debian.mirror.iweb.ca/debian/'],
464+
repos: ['main', 'contrib', 'non-free']
465+
},
466+
)
467+
end
468+
469+
it { is_expected.to contain_apt__setting("sources-#{title}").with_ensure('absent') }
470+
end
471+
458472
context 'complex deb822 source' do
459473
let :params do
460474
super().merge(

0 commit comments

Comments
 (0)