Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkala committed Oct 11, 2024
1 parent 273f39d commit 914502d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes/192.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes lack of logging of certain termination based failures.
6 changes: 3 additions & 3 deletions nautobot_device_onboarding/jinja_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def junos_get_valid_interfaces(interfaces):
"""Get valid interfaces from Junos."""
result = {}
for interface in interfaces:
result[interface['name']] = {}
if interface['units']:
for unit in interface['units']:
result[interface["name"]] = {}
if interface["units"]:
for unit in interface["units"]:
result[f"{interface['name']}.{unit}"] = {}
return result
2 changes: 1 addition & 1 deletion nautobot_device_onboarding/nornir_plays/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def subtask_instance_completed(self, task: Task, host: Host, result: MultiResult
"""Processor for logging and data processing on subtask completed."""
self.logger.info(
f"Subtask {'failed' if result.failed else 'succeeded'}: {task.name}, {task.host}.",
extra={"object": task.host}
extra={"object": task.host},
)
if result.failed:
for res in result:
Expand Down

0 comments on commit 914502d

Please sign in to comment.