def cleanup_forgotten_down(): """Clean up hosts forgotten down""" log.debug("Cleaning up hosts forgotten down") hosts_forgotten_down = get_hosts_forgotten_down(grace=seconds_to_nanoseconds(10 * 60)) if hosts_forgotten_down: up(hostnames=hosts_forgotten_down) else: log.debug("No hosts forgotten down")
def cleanup_forgotten_draining(): """Clean up hosts forgotten draining""" log.debug("Cleaning up hosts forgotten draining") hosts_forgotten_draining = get_hosts_forgotten_draining(grace=seconds_to_nanoseconds(10 * 60)) if hosts_forgotten_draining: undrain(hostnames=hosts_forgotten_draining) else: log.debug("No hosts forgotten draining")
def test_seconds_to_nanoseconds(): assert seconds_to_nanoseconds(60) == 60 * 1000000000