diff options
Diffstat (limited to 'chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb')
-rw-r--r-- | chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb index 6dd678840a..ca1bdb4c0b 100644 --- a/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb +++ b/chef-config/lib/chef-config/mixin/fuzzy_hostname_matcher.rb @@ -21,9 +21,11 @@ module ChefConfig module FuzzyHostnameMatcher def fuzzy_hostname_match_any?(hostname, matches) - return matches.to_s.split(/\s*,\s*/).compact.any? do |m| - fuzzy_hostname_match?(hostname, m) - end if (hostname != nil) && (matches != nil) + if (!hostname.nil?) && (!matches.nil?) + return matches.to_s.split(/\s*,\s*/).compact.any? do |m| + fuzzy_hostname_match?(hostname, m) + end + end false end |