Skip to content

Commit

Permalink
Stop redeclaring variables from params
Browse files Browse the repository at this point in the history
It really seems unnecessary.
  • Loading branch information
Morgan Haskel committed Feb 20, 2015
1 parent 59c362a commit ae71c42
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 2 additions & 4 deletions manifests/pin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
$originator = '', # o=
$label = '' # l=
) {
$preferences_d = $apt::params::preferences_d

if $order != '' and !is_integer($order) {
fail('Only integers are allowed in the apt::pin order param')
}
Expand Down Expand Up @@ -65,8 +63,8 @@
$file_name = regsubst($title, '[^0-9a-z\-_\.]', '_', 'IG')

$path = $order ? {
'' => "${preferences_d}/${file_name}.pref",
default => "${preferences_d}/${order}-${file_name}.pref",
'' => "${apt::params::preferences_d}/${file_name}.pref",
default => "${apt::params::preferences_d}/${order}-${file_name}.pref",
}
file { "${file_name}.pref":
ensure => $ensure,
Expand Down
8 changes: 3 additions & 5 deletions manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
) {
include apt::update

$sources_list_d = $apt::params::sources_list_d

if ! $release {
fail('lsbdistcodename fact not available: release parameter required')
}
Expand Down Expand Up @@ -49,7 +47,7 @@
exec { "add-apt-repository-${name}":
environment => $proxy_env,
command => "/usr/bin/add-apt-repository ${options} ${name}",
unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
unless => "/usr/bin/test -s ${apt::params::sources_list_d}/${sources_list_d_filename}",
user => 'root',
logoutput => 'on_failure',
notify => Exec['apt_update'],
Expand All @@ -59,14 +57,14 @@
],
}

file { "${sources_list_d}/${sources_list_d_filename}":
file { "${apt::params::sources_list_d}/${sources_list_d_filename}":
ensure => file,
require => Exec["add-apt-repository-${name}"],
}
}
else {

file { "${sources_list_d}/${sources_list_d_filename}":
file { "${apt::params::sources_list_d}/${sources_list_d_filename}":
ensure => 'absent',
notify => Exec['apt_update'],
}
Expand Down
5 changes: 1 addition & 4 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
validate_string($architecture)
validate_bool($trusted_source)

$sources_list_d = $apt::params::sources_list_d
$provider = $apt::params::provider

if $release == 'UNDEF' {
if $::lsbdistcodename == undef {
fail('lsbdistcodename fact not available: release parameter required')
Expand All @@ -37,7 +34,7 @@

file { "${name}.list":
ensure => $ensure,
path => "${sources_list_d}/${name}.list",
path => "${apt::params::sources_list_d}/${name}.list",
owner => root,
group => root,
mode => '0644',
Expand Down

0 comments on commit ae71c42

Please sign in to comment.