-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Unimplemented method #93
Comments
Could you post a full stack trace? |
Traceback (most recent call last): |
That stack trace doesn't seem to match up with the error of "Unimplemented method!". Could you post the exception and message as well? i.e. the lines following the ones you've just posted. |
Actually, come to think of it, I'm not sure that error is coming from spur: I was thinking the error was coming from an unimplemented method in the minimal shell type, but that's not the error that gets raised in that circumstance. Based on the stack trace, spur is invoking the given command, and that command is producing the error you're seeing. |
Here is the contents of the results that I get back. spur.results.RunProcessError: return code: 255 The command I am issuing is "show clock". I have manually logged onto the same device that the script is logging into using the same credentials and issued the same command it and gives me an output. So it sounds like I can't use spur than because if I don't use the minimal shell then the script hangs when it tries to execute the command. And if I use the minimal shell that I get the error. |
One thing worth checking would be how the default shell on your target handles escaping. Spur uses single quotes to escape commands. |
Thank you for you assistance. I asked the manufacture of the switch for some help as well. They ended up providing this as part of their response but I don't completely understand it but maybe you do.
They provided a script that shows how to do it in python. I don't know if this kind of shell is possible but this is the sample code that demostrate it working with their switch.
|
If the above works, then my guess would still be that the problem is the escaping that Spur does. If that's the case, you could either implement your own shell with the correct escaping, or just use paramiko with the code above. |
I am trying to connect to a cisco style switch to collect some data about it to show on a screen. First the code would hang and I tracked that down and resolved it by telling it to use a minimal shell. It gets past the login and throws an error of "Unimplemented method!" with an error code of 255. I can ssh into the same switch using the same credentials and execute the same command and get back a proper response.
I have used this same code to connect to a typical linux machine (with a similar command) and that worked fine.
Any ideas on where that error is coming from? (Sample of my code below)
shell = spur.SshShell( hostname=ssh_host, username=ssh_username, password=ssh_password, port=ssh_port, missing_host_key=spur.ssh.MissingHostKey.accept, shell_type=spur.ssh.ShellTypes.minimal, )
c = ["show", "clock"]
print(c)
results = shell.run(c)
I expect it to return something along the lines of:
16:04:40 MDT Wed Sep 08 2021
The text was updated successfully, but these errors were encountered: