diff options
Diffstat (limited to 'lib/puppet/node.rb')
-rw-r--r-- | lib/puppet/node.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/puppet/node.rb b/lib/puppet/node.rb index 2418b3e44..47be43168 100644 --- a/lib/puppet/node.rb +++ b/lib/puppet/node.rb @@ -32,9 +32,7 @@ class Puppet::Node end def initialize(name, options = {}) - unless name - raise ArgumentError, "Node names cannot be nil" - end + raise ArgumentError, "Node names cannot be nil" unless name @name = name if classes = options[:classes] @@ -81,15 +79,11 @@ class Puppet::Node # Calculate the list of names we might use for looking # up our node. This is only used for AST nodes. def names - if Puppet.settings[:strict_hostname_checking] - return [name] - end + return [name] if Puppet.settings[:strict_hostname_checking] names = [] - if name.include?(".") - names += split_name(name) - end + names += split_name(name) if name.include?(".") # First, get the fqdn unless fqdn = parameters["fqdn"] @@ -102,9 +96,7 @@ class Puppet::Node # Now that we (might) have the fqdn, add each piece to the name # list to search, in order of longest to shortest. - if fqdn - names += split_name(fqdn) - end + names += split_name(fqdn) if fqdn # And make sure the node name is first, since that's the most # likely usage. |