Open brahmastra2016 opened 5 years ago
@brahmastra2016 For now start shell takes user credentials to make ssh connection. We need to extend this Class for on-box support (so that user dont need to pass credentials).
User can use subprocess functions to achieve what he intend to do using StartShell.
For on-box pyhton script we just use "dev = dev = Device()" to connect but it throw exception error since start shell module has the user/password as required parameters.
root@Nemo> op test.py
Traceback (most recent call last): File "/var/db/scripts/op/test.py", line 104, in
main()
File "/var/db/scripts/op/test.py", line 78, in main
with StartShell(dev) as ss:
File "../../../../../../../../src/dist/python-add-ons/junos-eznc/lib/jnpr/junos/utils/start_shell.py", line 170, in enter
File "../../../../../../../../src/dist/python-add-ons/junos-eznc/lib/jnpr/junos/utils/start_shell.py", line 102, in open
RuntimeError
:
StartShell requires user credentials
error: op script failed: /var/db/scripts/op/test.py