Make test sockets less dependent on enviroment
It seems that ruby in a default wheezy VM can't handle a source address of nil.
This commit is contained in:
@@ -9,7 +9,11 @@ module FlexNBD
|
|||||||
|
|
||||||
def initialize( addr, port, err_msg, source_addr=nil, source_port=0 )
|
def initialize( addr, port, err_msg, source_addr=nil, source_port=0 )
|
||||||
timing_out( 2, err_msg ) do
|
timing_out( 2, err_msg ) do
|
||||||
@sock = TCPSocket.new( addr, port, source_addr, source_port )
|
@sock = if source_addr
|
||||||
|
TCPSocket.new( addr, port, source_addr, source_port )
|
||||||
|
else
|
||||||
|
TCPSocket.new( addr, port )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user