Skip to content

Commit

Permalink
Merge pull request #106 from chef-cookbooks/jtimberman/use-ingredient…
Browse files Browse the repository at this point in the history
…s-fqdn-resolves

Fixes #105, move the fqdn_resolves method
  • Loading branch information
jtimberman committed Aug 31, 2015
2 parents 1eb13c0 + 9579aab commit a020029
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ def api_fqdn_available?
end

def api_fqdn_resolves?
require 'resolv'
Resolv.getaddress(node['chef-server']['api_fqdn'])
return true
rescue
false
ChefIngredientCookbook::Helpers.fqdn_resolves?(
node['chef-server']['api_fqdn']
)
end

def repair_api_fqdn
Expand Down
1 change: 0 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

cache_path = Chef::Config[:file_cache_path]

# see helpers.rb
ruby_block 'ensure node can resolve API FQDN' do
extend ChefServerCookbook::Helpers
block { repair_api_fqdn }
Expand Down

0 comments on commit a020029

Please sign in to comment.