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

Junos get_config patch #2150

Conversation

SenorRodriguez
Copy link

If no format attribute is specified get_config returns config as a plain text, but in json is specified, it returns a dict.
Probably it still needs further polishing. e.g I cast it to a str, but maybe i could stay as dict. It's my first pull request ever, Sorry if I messed something up.

If no format attribute is specified get_config returns config as a plain text, but in json is specified, it returns a dict. 
Probably it still needs further polishing. e.g I cast it to a str, but maybe i could stay as dict.  It's my first pull request ever, Sorry if I messed something up.
@ktbyers
Copy link
Contributor

ktbyers commented Oct 22, 2024

@SenorRodriguez Can you provide some more details on the problem you are trying to solve i.e. what use case you are running into issues and how Netmiko currently behaves in that use case?

@SenorRodriguez
Copy link
Author

I was trying to write some code for validating get_config, when I noticed that getting JSON was also not possible (as mentioned in pull req comment) This was my attempt to fix that. Didn't even try netmiko yet.

@ktbyers
Copy link
Contributor

ktbyers commented Oct 22, 2024

@SenorRodriguez Yeah, the Netmiko comment was just my mistake...I should have said napalm there.

@SenorRodriguez
Copy link
Author

SenorRodriguez commented Oct 22, 2024

I'm off my work PC, but in case I try to get a config in json format, napalm throws something like "config" dosn't have 'text' property", and sure enough - it returns dict instead of string
-edit-
dammit! I already noticed an error in my 4 lines of code :D After the the second 'else' there should be obviously rv["running"] = ...
Sorry, if i ever make a pull request again, ill try to be more cautious :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants