def check_ports(): """ Check of Directory server ports are open. Returns a tuple with two booleans, one for unsecure port 389 and one for secure port 636. True means that the port is free, False means that the port is taken. """ ds_unsecure = not ipautil.host_port_open(None, 389) ds_secure = not ipautil.host_port_open(None, 636) return (ds_unsecure, ds_secure)
def _check_port(self, port): """ Verify if the port given is available. Returns True if port is already in use else returns False """ return ipautil.host_port_open(None, port)