From: intrigeri Date: Tue, 8 Jan 2013 17:13:23 +0000 (+0100) Subject: Don't check for source / content to be set when removing an APT source. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=14670466be5eceba043e697d5f6f0f0ada9d5b07;p=puppet-apt.git Don't check for source / content to be set when removing an APT source. Else, the sanity checks prevent one from using a simple apt::sources_list { "sid.list": ensure => absent } --- diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 00f6097..3367f83 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -4,11 +4,13 @@ define apt::sources_list ( $content = undef ) { - if $source == '' and $content == undef { - fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}") - } - if $source != '' and $content != undef { - fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}") + if $ensure == 'present' { + if $source == '' and $content == undef { + fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}") + } + if $source != '' and $content != undef { + fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}") + } } include apt::dot_d_directories