Cool, glad to see this getting in. I was about to review it to say it looked good since I had worked on it with you a month ago, but I see it's already been merged with Jacob's review.
On Thu, May 12, 2011 at 12:31 PM, nfagerlund <nick.fagerl...@gmail.com> wrote: > Although URLs with usernames and passwords were valid in the previous version > of the external_node > script, they weren't being passed in the HTTP request. This commit adds a > username and password > to the request if a user is present in the URL. > > The "if uri.user" isn't strictly necessary, since requests with blank > usernames/passwords > will still succeed if basic auth isn't enabled in Dashboard, but it adds > clarity. > > Signed-off-by: nfagerlund <nick.fagerl...@gmail.com> > --- > Local-branch: ticket/next/5126 > bin/external_node | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/bin/external_node b/bin/external_node > index 36aa2e6..08d00d8 100755 > --- a/bin/external_node > +++ b/bin/external_node > @@ -29,6 +29,8 @@ url = ENV['PUPPET_DASHBOARD_URL'] || DASHBOARD_URL > uri = URI.parse("#{url}/nodes/#{NODE}") > require 'net/https' if uri.scheme == 'https' > > +request = Net::HTTP::Get.new(uri.path, initheader = {'Accept' => > 'text/yaml'}) > +request.basic_auth uri.user, uri.password if uri.user > http = Net::HTTP.new(uri.host, uri.port) > if uri.scheme == 'https' > cert = File.read(cert_path) > @@ -39,7 +41,7 @@ if uri.scheme == 'https' > http.ca_file = ca_path > http.verify_mode = OpenSSL::SSL::VERIFY_PEER > end > -result = http.start { http.request_get(uri.path, 'Accept' => 'text/yaml') } > +result = http.start {|http| http.request(request)} > > case result > when Net::HTTPSuccess; puts result.body; exit 0 > -- > 1.7.3.3 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to puppet-dev@googlegroups.com. > To unsubscribe from this group, send email to > puppet-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.