From 4ee686d61938d60d38103fd4d6b5e4bb621779ac Mon Sep 17 00:00:00 2001 From: Johan Marcusson Date: Wed, 1 Nov 2023 12:32:02 +0100 Subject: [PATCH] commit_message not implemented on napalm EOS driver, causes error with commit_mode 0. don't wait for rollback on commit mode 0 --- src/cnaas_nms/devicehandler/sync_devices.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cnaas_nms/devicehandler/sync_devices.py b/src/cnaas_nms/devicehandler/sync_devices.py index 0ab32ecc..87726f09 100644 --- a/src/cnaas_nms/devicehandler/sync_devices.py +++ b/src/cnaas_nms/devicehandler/sync_devices.py @@ -546,7 +546,6 @@ def push_sync_device( "replace": True, "configuration": task.host["config"], "dry_run": dry_run, - "commit_message": "Job id {}".format(job_id), } if dry_run: task_args["task"] = napalm_configure @@ -949,11 +948,12 @@ def sync_devices( dev.last_seen = datetime.datetime.utcnow() if not dry_run and get_confirm_mode(confirm_mode_override) != 2: if failed_hosts: - logger.error( - "One or more devices failed to commit configuration, they will roll back configuration" - " in {}s: {}".format(api_settings.COMMIT_CONFIRMED_TIMEOUT, ", ".join(failed_hosts)) - ) - time.sleep(api_settings.COMMIT_CONFIRMED_TIMEOUT) + if get_confirm_mode(confirm_mode_override) == 1: + logger.error( + "One or more devices failed to commit configuration, they will roll back configuration" + " in {}s: {}".format(api_settings.COMMIT_CONFIRMED_TIMEOUT, ", ".join(failed_hosts)) + ) + time.sleep(api_settings.COMMIT_CONFIRMED_TIMEOUT) logger.info("Releasing lock for devices from syncto job: {}".format(job_id)) Joblock.release_lock(session, job_id=job_id)