Skip to content

Add debug page to assist in writing command_mappers #316

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

Open
msheiny opened this issue Feb 7, 2025 · 1 comment
Open

Add debug page to assist in writing command_mappers #316

msheiny opened this issue Feb 7, 2025 · 1 comment
Labels
type: feature Introduction of substantial new functionality to the application

Comments

@msheiny
Copy link
Contributor

msheiny commented Feb 7, 2025

Proposed Functionality

As a device onboarding power user, whom is tasked with expanding device compatibility, I want the ability to debug and develop command_mappers quickly.

Use Case

The current workflow of developing custom command_mappers can be a black box experience when things are not working as expected:

  • The logging output from the job that comes from jinja can lead to mysterious error messages. I tried to improve this a bit in Expand tests to cover ssh logic #315 with a single expansion of the log statements. Suspect we can do additional logging expansion here.
  • It's not 100% clear what is being passed to the jmespath / jinja filters at all times based on the documentation and naming conventions. It seems that obj is an ip address in most of the examples but sometimes it's also an obj with unknown parameters.

I propose we add a new page to the nautobot app explicitly for debugging command_mappers with the following inputs:

  1. A textarea that allows pasting of Raw output of the target device in question
  2. A textarea where you can paste the YAML chunk that defines a command:
        command: "show version"
        parser: "textfsm"
        jpath: "[*].hostname"
        post_processor: "{{ obj[0] | upper }}"
  1. A button to trigger the test which will output debug information of what goes into each parser and comes out of it. So for the example above I'd want to see:
  • The input that was passed into jpath
  • The input that was passed into post_processor
  • The final output that would be passed into the device onboarding app from this command parser.
  • Any explicit errors encountered during this process.
@msheiny msheiny added the enhancement New feature or request label Feb 7, 2025
@gt732
Copy link

gt732 commented Feb 14, 2025

I agree, currently going through this now writing an integration with a new device. It's very difficult trying to troubleshoot what exactly is happening behind the scenes especially whats being passed to jmespath/jinja at different stages of the import.

@smk4664 smk4664 added type: feature Introduction of substantial new functionality to the application and removed enhancement New feature or request labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of substantial new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants