lib/fog/ecloud/requests/compute/node_service_create.rb in fog-1.22.0 vs lib/fog/ecloud/requests/compute/node_service_create.rb in fog-1.22.1
- old
+ new
@@ -2,11 +2,11 @@
module Compute
class Ecloud
module Shared
def validate_node_service_data(service_data)
required_opts = [:name, :port, :enabled, :ip_address]
- unless required_opts.all? { |opt| service_data.has_key?(opt) }
+ unless required_opts.all? { |opt| service_data.key?(opt) }
raise ArgumentError.new("Required Internet Service data missing: #{(required_opts - service_data.keys).map(&:inspect).join(", ")}")
end
end
end
@@ -49,10 +49,10 @@
internet_service = self.data[:internet_services][internet_service_id.to_i].dup
network_id, ip_address_name = service_data[:ip_address].match(/\/(\d+)\/(.*)$/).captures
network = self.data[:networks][network_id.to_i]
ip_addresses = network[:IpAddresses][:IpAddress]
ip_addresses = ip_addresses.is_a?(Array) ? ip_addresses : [ip_addresses]
- ip_address = ip_addresses.detect { |ip| ip[:name] == ip_address_name }
+ ip_address = ip_addresses.find { |ip| ip[:name] == ip_address_name }
service_id = Fog::Mock.random_numbers(6).to_i
service = {
:href => "/cloudapi/ecloud/nodeservices/#{service_id}",
:name => service_data[:name],