Bug #122

External nodes script shouldn't output anything if node not found

Added by Frank Sweetser over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:12/08/2009
Priority:NormalDue date:
Assignee:Ohad Levy% Done:

100%

Category:External Nodes
Target version:0.1-3
Difficulty: Bugzilla link:
Found in release:
Story points-
Velocity based estimate-

Description

If I'm reading http://reductivelabs.com/trac/puppet/wiki/ExternalNodes correctly, an external nodes script should produce no output in the case where a node is not found. This patch modifies the external node script to only output the response body if the return HTTP code is 200, and output a brief message to stderr otherwise. It also updates routes.rb to not choke on the puppetmaster node search (host.domain, host, default).

0001-Only-output-yaml-when-node-is-found-for-puppetmaster.patch Magnifier (1.81 KB) Frank Sweetser, 12/08/2009 05:51 pm

Associated revisions

Revision 8b96913a
Added by Frank Sweetser over 4 years ago

Fixes #122 - Only output yaml when node is found for puppetmasters host search function

History

#1 Updated by Ohad Levy over 4 years ago

  • Status changed from New to Assigned
  • Target version set to 0.1-3

I'll apply the patch, but just one minor thing to note, the regexp will allow to query for short names as well, currently we only support querying for fqdn values (e.g. if you query for plain "hostname" it will always return 404)

#2 Updated by Frank Sweetser over 4 years ago

I figured that it made sense to do that for two reasons - one, to handle the short hostname check that puppetmaster does if it can't find the FQDN, and two, for sites that don't use the hostname to identify the puppet node (I saw at least one place that generates a GUID for each node).

Either way, thanks =)

#3 Updated by Frank Sweetser over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • % Done changed from 0 to 100

#4 Updated by Ohad Levy over 4 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF