Skip to content

Commit

Permalink
Allow empty string for release in apt::source
Browse files Browse the repository at this point in the history
This fixes a regression from commit 0a178c3.

Some repos don't have a release. This allows using such repos.

Tests added to make sure when release is set to an empty string the
source file is rendered correctly.

All other tests are passing.
  • Loading branch information
tomduckering authored and Helen Campbell committed May 26, 2017
1 parent 03baf34 commit e7280cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Optional[String] $location = undef,
String $comment = $name,
String $ensure = present,
Optional[String] $release = undef,
Optional[String] $release = 'UNDEF',
String $repos = 'main',
Optional[Variant[Hash]] $include = {},
Optional[Variant[String, Hash]] $key = undef,
Expand All @@ -19,10 +19,10 @@

$_before = Apt::Setting["list-${title}"]

if ! $release {
if $release == 'UNDEF' {
if $facts['lsbdistcodename'] {
$_release = $facts['lsbdistcodename']
} else {
$_release = $facts['lsbdistcodename']
unless $_release {
fail('lsbdistcodename fact not available: release parameter required')
}
} else {
Expand Down

0 comments on commit e7280cb

Please sign in to comment.