saltfactories.utils.ports

Ports related utility functions

saltfactories.utils.ports.get_unused_localhost_port(use_cache=False)[source]
Parameters

use_cache (bool) – If use_cache is True, consecutive calls to this function will never return the cached port.

Return a random unused port on localhost

saltfactories.utils.ports.get_connectable_ports(ports)[source]
Parameters

ports (Iterable) – An iterable of ports to try and connect to

Return type

set

Returns

Returns a set of the ports where connection was successful