sometimesfood/chef-apt-repo — Issue #4: Nasty PPA error
Author: joerg
Created: 2012-03-02 10:04:37+00:00
State: open

Hi,

I just stumbled over a nasty looking error in the ppa defintion. When copy/pasting the ppa url from launchpad the way add-apt-repository expects it (ppa:webupd8team/gnome3) then sandwich returns:

root@precise /home/joerg/chef # sandwich sandwichfile
sandwich: 404 Not Found
root@precise /home/joerg/chef # sandwich -l debug sandwichfile
[Fri, 02 Mar 2012 10:44:15 +0100] INFO: *** Chef 0.10.8 ***
[Fri, 02 Mar 2012 10:44:16 +0100] INFO: Starting Chef Run for precise.oiml.at
...
[Fri, 02 Mar 2012 10:44:17 +0100] DEBUG: Re-raising exception: OpenURI::HTTPError - 404 Not Found
/usr/lib/ruby/1.8/open-uri.rb:277:in `open_http'
/usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
/usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
/usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
/usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
...

This error is misleading, and somehow it would be intuitive to just copy/paste the ppa string from launchpad. Maybe adding one of code lines below would be a good idea.

ppa = params[:name].sub("ppa:","")
OR
ppa = params[:name]
ppa.slice!("ppa:")