utils.network: Also check for UDP protocols in is_port_free
Binding port won't complain when port already opened for UDP packets and
we are trying to bind it for TCP packets. Let's do a combination.
Note I also tried:
tuple(getattr(socket, _) for _ in dir(socket)
if _.startswith('SOCK_')
to cover all of the protocols, but all the time they just reported
incorrect combination so let's just stick with the most common ones.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
Showing
想要评论请 注册 或 登录