Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes out of scope logs, fix git repo provides #288

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/277.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed multiple git repo provides not working, change filter logic to contains from exact.
1 change: 1 addition & 0 deletions changes/287.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix conditional logic to only show job log entries when git repo is used.
11 changes: 6 additions & 5 deletions nautobot_device_onboarding/nornir_plays/command_getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ def netmiko_send_commands(
try:
# Look for custom textfsm templates in the git repo
git_template_dir = get_git_repo_parser_path(parser_type="textfsm")
if not check_for_required_file(git_template_dir, "index"):
logger.debug(
f"Unable to find required index file in {git_template_dir} for textfsm parsing. Falling back to default templates."
)
git_template_dir = None
if git_template_dir:
if not check_for_required_file(git_template_dir, "index"):
logger.debug(
f"Unable to find required index file in {git_template_dir} for textfsm parsing. Falling back to default templates."
)
git_template_dir = None
# Parsing textfsm ourselves instead of using netmikos use_<parser> function to be able to handle exceptions
# ourselves. Default for netmiko is if it can't parse to return raw text which is tougher to handle.
parsed_output = parse_output(
Expand Down
4 changes: 2 additions & 2 deletions nautobot_device_onboarding/nornir_plays/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def get_git_repo():
"""Get the git repo object."""
if (
GitRepository.objects.filter(
provided_contents=["nautobot_device_onboarding.onboarding_command_mappers"]
provided_contents__contains="nautobot_device_onboarding.onboarding_command_mappers"
).count()
== 1
):
repository_record = GitRepository.objects.filter(
provided_contents=["nautobot_device_onboarding.onboarding_command_mappers"]
provided_contents__contains="nautobot_device_onboarding.onboarding_command_mappers"
).first()
return repository_record
return None
Expand Down