def wait_for_delete(app_id, client): """Wait for the specified app_id to not be listed in marathon anymore. Waits WAIT_DELETE_S seconds inbetween checks. :param app_id: The app_id to check for deletion :param client: A MarathonClient object""" while marathon_tools.is_app_id_running(app_id, client) is True: log.info("Waiting for %s to be deleted from marathon...", app_id) time.sleep(WAIT_DELETE_S)
def wait_for_create(app_id, client): """Wait for the specified app_id to be listed in marathon. Waits WAIT_CREATE_S seconds between calls to list_apps. :param app_id: The app_id to ensure creation for :param client: A MarathonClient object""" while marathon_tools.is_app_id_running(app_id, client) is False: log.info("Waiting for %s to be created in marathon..", app_id) time.sleep(WAIT_CREATE_S)