Issue #1554 has been updated by pawalls. File puppet-0.24.5_handle_node_without_hostname.patch added
Sorry for the confusion, the code nigelk2 posted above is on the money. I had intended to post the original patch but had to run out of the office in a hurry. Attaching the original patch now for completeness. It's worth noting that the outer unless block isn't actually necessary with the current crop of Puppet clients. Based on my limited observation the client will never have an FQDN set if the hostname isn't set, so that block becomes redundant. -P ---------------------------------------- Bug #1554: Puppetmaster throws exception if client has undefined hostname http://reductivelabs.com/redmine/issues/show/1554 Author: pawalls Status: Code Insufficient Priority: Normal Assigned to: Category: node Target version: Complexity: Unknown Affected version: 0.24.5 Keywords: The following code in lib/puppet/node.rb (names) tries to find names to refer to a client by if an FQDN wasn't provided by the client: <pre> # First, get the fqdn unless fqdn = parameters["fqdn"] if domain = parameters["domain"] fqdn = parameters["hostname"] + "." + parameters["domain"] end end </pre> In addition to assignment in conditionals being an abomination against mankind, under most (all?) circumstances, when the FQDN is undefined, the hostname is also undefined. This results in fun errors like the following: <pre> undefined method `+' for nil:NilClass on node XXXXX-XXXXXXX-XXXXXXX-XXXX </pre> Which prevents clients from getting a compiled configuration from the puppetmaster daemon. The fix is quite simple: <pre> if parameters["hostname"] and parameters["domain"] fqdn = parameters["hostname"] + "." + parameters["domain"] else Puppet.warning "Host is missing hostname and/or domain: %s" % name end </pre> Cheers, -P ---------------------------------------- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en -~----------~----~----~----~------~----~------~--~---
