From ded81d8edcc9a7cc8275a68f669fde896379b12e Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 2 Jan 2013 08:12:11 -0500 Subject: Apply code style corrections from puppet-lint Signed-off-by: Gabriel Filion + more linting by intrigeri. Conflicts: manifests/apticron.pp manifests/cron/dist_upgrade.pp manifests/cron/download.pp manifests/dist_upgrade/initiator.pp manifests/init.pp manifests/listchanges.pp manifests/preferences.pp manifests/preseeded_package.pp manifests/proxy_client.pp manifests/unattended_upgrades.pp manifests/update.pp --- manifests/sources_list.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/sources_list.pp') diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 499116d..00f6097 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -1,8 +1,8 @@ define apt::sources_list ( $ensure = 'present', $source = '', - $content = undef ) -{ + $content = undef +) { if $source == '' and $content == undef { fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}") @@ -18,7 +18,7 @@ define apt::sources_list ( # apparently doesn't. file { "/etc/apt/sources.list.d/${name}": ensure => $ensure, - owner => root, group => 0, mode => 0644, + owner => root, group => 0, mode => '0644', notify => Exec['refresh_apt'], } -- cgit v1.2.3 From 14670466be5eceba043e697d5f6f0f0ada9d5b07 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 8 Jan 2013 18:13:23 +0100 Subject: 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 } --- manifests/sources_list.pp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'manifests/sources_list.pp') 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 -- cgit v1.2.3