Permalink
Browse files

Fix a 1.8.7 bug

  • Loading branch information...
1 parent 24f7192 commit 66802dfb3028f2079c8d0dda5124bcabab3d4ba4 @soupmatt soupmatt committed Oct 5, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/capistrano/chef.rb
  2. +1 −1 spec/capistrano/chef_spec.rb
View
@@ -23,7 +23,7 @@ def self.search_chef_nodes(query = '*:*', arg = :ipaddress, limit = 1000)
iface, family = arg.keys.first.to_s, arg.values.first.to_s
Proc.new do |n|
addresses = n["network"]["interfaces"][iface]["addresses"]
- addresses.select{|address, data| data["family"] == family }.keys.first
+ addresses.select{|address, data| data["family"] == family }.to_a.first.first
end
when Symbol, String
Proc.new{|n| n[arg.to_s]}
@@ -89,7 +89,7 @@
# use Proc for more deep, complex attributes search.
specify 'with Proc argument' do
search_proc = Proc.new do |n|
- n["network"]["interfaces"]["eth1"]["addresses"].select{|address, data| data["family"] == "inet" }.keys.first
+ n["network"]["interfaces"]["eth1"]["addresses"].select{|address, data| data["family"] == "inet" }.to_a.first.first
end
Capistrano::Chef.search_chef_nodes('*:*', search_proc).should eql ['192.168.77.101']
end

0 comments on commit 66802df

Please sign in to comment.