Skip to content

Commit

Permalink
Fix the order of printing of log message to release job lock
Browse files Browse the repository at this point in the history
  • Loading branch information
indy-independence committed Sep 11, 2023
1 parent 6343563 commit 33cacd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cnaas_nms/devicehandler/sync_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,13 +948,13 @@ def sync_devices(
remove_sync_events(hostname)
dev.last_seen = datetime.datetime.utcnow()
if not dry_run and get_confirm_mode(confirm_mode_override) != 2:
logger.info("Releasing lock for devices from syncto job: {}".format(job_id))
if failed_hosts:
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#L952

Added line #L952 was 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)

if len(device_list) == 0:
Expand Down

0 comments on commit 33cacd7

Please sign in to comment.