]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #304 from innyso/allow_url_for_key_server
authorDaniele Sluijters <github@daenney.net>
Thu, 26 Jun 2014 12:29:36 +0000 (14:29 +0200)
committerDaniele Sluijters <github@daenney.net>
Thu, 26 Jun 2014 12:29:36 +0000 (14:29 +0200)
Allow url for key server

README.md
manifests/source.pp
spec/acceptance/apt_key_provider_spec.rb
spec/acceptance/force_spec.rb
spec/defines/source_spec.rb
templates/source.list.erb

index cbaab7247232d8baac139ac76175972e0d456c96..f92122fb348330e0753d8411b6d63065907d3363 100644 (file)
--- a/README.md
+++ b/README.md
@@ -194,6 +194,7 @@ Sets the default apt release. This class is particularly useful when using repos
 Adds an apt source to `/etc/apt/sources.list.d/`.
 
     apt::source { 'debian_unstable':
+      comment           => 'This is the iWeb Debian unstable mirror',
       location          => 'http://debian.mirror.iweb.ca/debian/',
       release           => 'unstable',
       repos             => 'main contrib non-free',
index 196fc925866435dec0a3b038c8b65054542ea84e..dd00adc6a4e62a6943cc5f0368596bd4d7c7ff4d 100644 (file)
@@ -2,6 +2,7 @@
 # add an apt source
 
 define apt::source(
+  $comment           = $name,
   $ensure            = present,
   $location          = '',
   $release           = 'UNDEF',
index 573452e28b97a44f194a0d3aa0230930fbaf9cb1..d9c2c0d7518c8534b8c89e12933926277124e2cf 100644 (file)
@@ -219,7 +219,7 @@ ugVIB2pi+8u84f+an4Hml4xlyijgYu05pqNvnLRyJDLd61hviLC8GYU=
         EOS
 
         apply_manifest(pp, :expect_failures => true) do |r|
-          expect(r.stderr).to match(/Host not found/)
+          expect(r.stderr).to match(/(Host not found|Couldn't resolve host)/)
         end
       end
     end
index a43902300d7c0c1067db5660ee82396186eda631..5f4dec3fc76487705b147c368a3563bf194da2e3 100644 (file)
@@ -59,7 +59,7 @@ describe 'apt::force define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('os
     it 'should work with no errors' do
       pp = <<-EOS
       include apt
-      apt::force { 'vim': timeout => '1' }
+      apt::force { 'ocaml': timeout => '1' }
       EOS
 
       shell('apt-get clean')
@@ -68,7 +68,7 @@ describe 'apt::force define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('os
       end
     end
 
-    describe package('vim') do
+    describe package('ocaml') do
       it { should_not be_installed }
     end
   end
index 34b394282fd4df1d8c6011fcf479a4370e629570..7c7ae399e84768fe3d51daca47c67a49c35b8855 100644 (file)
@@ -74,7 +74,12 @@ describe 'apt::source', :type => :define do
       end
 
       let :content do
-        content = "# #{title}"
+        content = "#file generated by puppet\n"
+       if param_hash[:comment]
+         content << "# #{comment}"
+       else
+         content << "# #{title}"
+       end
         if param_hash[:architecture]
           arch = "[arch=#{param_hash[:architecture]}] "
         end
index 9946966ee5322dab85336320c1adfba88999381e..a57244fce81e61be50470cdbdd7c39c741468312 100644 (file)
@@ -1,4 +1,5 @@
-# <%= @name %>
+#file generated by puppet
+# <%= @comment %>
 deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
 <%- if @include_src then -%>
 deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>