lib/fog/hp/requests/network/add_router_interface.rb in fog-1.22.0 vs lib/fog/hp/requests/network/add_router_interface.rb in fog-1.22.1

- old
+ new

@@ -1,9 +1,8 @@ module Fog module HP class Network - class Real # Add an internal router interface, thus attaching a subnet or a port to an existing router # # ==== Parameters # * 'router_id'<~String>: - UUId for the router @@ -36,11 +35,11 @@ end class Mock def add_router_interface(router_id, subnet_id=nil, port_id=nil, options = {}) response = Excon::Response.new - if list_routers.body['routers'].detect {|_| _['id'] == router_id} + if list_routers.body['routers'].find {|_| _['id'] == router_id} # Either a subnet or a port can be passed, not both if (subnet_id && port_id) || (subnet_id.nil? && port_id.nil?) raise ArgumentError.new('Either a subnet or a port can be passed, not both') end @@ -67,9 +66,8 @@ else raise Fog::HP::Network::NotFound end end end - end end end