Skip to content

Commit

Permalink
Revert "Fix use of $::apt::params::backports and $::apt::params::xfac…
Browse files Browse the repository at this point in the history
…ts."
  • Loading branch information
Morgan Haskel committed Jun 22, 2015
1 parent 8f5cb73 commit 70c1863
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions manifests/backports.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$repos = undef,
$key = undef,
$pin = 200,
) inherits apt::params {

This comment has been minimized.

Copy link
@grigarr

grigarr Feb 20, 2016

This seems ... problematic. How does scoping work now?

This comment has been minimized.

Copy link
@daenney

daenney Feb 20, 2016

Read the documentation. You have to include the main apt class which inherits params. As long as you do that, everything works. Both the spec and integration tests prove this to be true too.

Note: The main apt class is required by all other classes, types, and defined types in this module. You must declare it whenever you use the module.

Much in the same way that you can't use apache::vhost without having an include apache you can't use the defined types of this module if you forgo inclusion of the main class.

){
if $location {
validate_string($location)
$_location = $location
Expand All @@ -29,18 +29,18 @@
}
}

if ($::apt::params::xfacts['lsbdistid'] == 'debian' or $::apt::params::xfacts['lsbdistid'] == 'ubuntu') {
if ($::apt::xfacts['lsbdistid'] == 'debian' or $::apt::xfacts['lsbdistid'] == 'ubuntu') {

This comment has been minimized.

Copy link
@grigarr

grigarr Feb 20, 2016

Will this ever have a value if there is no inheritance from params?

This comment has been minimized.

Copy link
@daenney

daenney Feb 20, 2016

Yes. Read the documentation. You have to include the main apt class which inherits params. As long as you do that, everything works. Both the spec and integration tests prove this to be true too.

Note: The main apt class is required by all other classes, types, and defined types in this module. You must declare it whenever you use the module.

Much in the same way that you can't use apache::vhost without having an include apache you can't use the defined types of this module if you forgo inclusion of the main class.

unless $location {
$_location = $::apt::params::backports['location']
$_location = $::apt::backports['location']
}
unless $release {
$_release = "${::apt::params::xfacts['lsbdistcodename']}-backports"
$_release = "${::apt::xfacts['lsbdistcodename']}-backports"
}
unless $repos {
$_repos = $::apt::params::backports['repos']
$_repos = $::apt::backports['repos']
}
unless $key {
$_key = $::apt::params::backports['key']
$_key = $::apt::backports['key']
}
} else {
unless $location and $release and $repos and $key {
Expand Down
6 changes: 2 additions & 4 deletions manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
define apt::ppa(
$ensure = 'present',
$options = $::apt::ppa_options,
$release = $::apt::params::xfacts['lsbdistcodename'],
$release = $::apt::xfacts['lsbdistcodename'],
$package_name = $::apt::ppa_package,
$package_manage = false,
) {
include 'apt::params'

unless $release {
fail('lsbdistcodename fact not available: release parameter required')
}

if $::apt::params::xfacts['lsbdistid'] == 'Debian' {
if $::apt::xfacts['lsbdistid'] == 'Debian' {
fail('apt::ppa is not currently supported on Debian.')
}

Expand Down

0 comments on commit 70c1863

Please sign in to comment.