Skip to content

Commit

Permalink
commit_message not implemented on napalm EOS driver, causes error wit…
Browse files Browse the repository at this point in the history
…h commit_mode 0. don't wait for rollback on commit mode 0
  • Loading branch information
indy-independence committed Nov 1, 2023
1 parent 815db9d commit 4ee686d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cnaas_nms/devicehandler/sync_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(

Check warning on line 952 in src/cnaas_nms/devicehandler/sync_devices.py

View check run for this annotation

Codecov / codecov/patch

src/cnaas_nms/devicehandler/sync_devices.py#L951-L952

Added lines #L951 - L952 were not covered by tests
"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)

Check warning on line 956 in src/cnaas_nms/devicehandler/sync_devices.py

View check run for this annotation

Codecov / codecov/patch

src/cnaas_nms/devicehandler/sync_devices.py#L956

Added line #L956 was not covered by tests
logger.info("Releasing lock for devices from syncto job: {}".format(job_id))
Joblock.release_lock(session, job_id=job_id)

Expand Down

0 comments on commit 4ee686d

Please sign in to comment.