def run_cumin(host, cmds, timeout=30, ignore_exit=False): try: lib.run_cumin(NAME, host, cmds, timeout=timeout, ignore_exit=ignore_exit) except RuntimeError: return False return True
def check_cumin_output(host, cmds, expected_output): """Return True if running cmds on the given host yields the expected output.""" _, worker = lib.run_cumin(NAME, host, cmds, ignore_exit=True) for _, output in worker.get_results(): return output.message().decode('utf-8') == expected_output return False