]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #681 from HelenCampbell/emptystringing
authorEric Putnam <putnam.eric@gmail.com>
Tue, 30 May 2017 15:13:13 +0000 (08:13 -0700)
committerGitHub <noreply@github.com>
Tue, 30 May 2017 15:13:13 +0000 (08:13 -0700)
Ensure release allows empty strings

manifests/source.pp
spec/defines/source_spec.rb

index a9769ea890c39bcdf098db2fac8e1d043c0a24ae..be743eb26ca207fc9a3c2b09f82a52caff3ae494 100644 (file)
@@ -19,7 +19,7 @@ define apt::source(
 
   $_before = Apt::Setting["list-${title}"]
 
-  if ! $release {
+  if !$release {
     if $facts['lsbdistcodename'] {
       $_release = $facts['lsbdistcodename']
     } else {
index c224668f4791bf350145bc391dd07ad0d39beaf0..79cc11b990d782ec58ef7f9e84a4c352a3ce0e3d 100644 (file)
@@ -373,6 +373,20 @@ describe 'apt::source' do
       end
     end
 
+    context 'release is empty string' do
+      let :facts do
+        {
+          :os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }},
+          :lsbdistid       => 'Debian',
+          :osfamily        => 'Debian',
+          :puppetversion   => Puppet.version,
+        }
+      end
+      let(:params) { { :location => 'hello.there', :release => '' } }
+
+      it { is_expected.to contain_apt__setting('list-my_source').with_content(/hello\.there  main/) }
+    end
+
     context 'invalid pin' do
       let :facts do
         {