question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Display device prompt

See original GitHub issue

Hello,

Is there a way to display the device prompt? This issue is related to issues #111 and #131.

Simply, I’d like to have this output:

<DEVICE>mmi-mode enable
Warning: Entered machine-to-machine mode. All the commands will be executed without being confirmed. Exercise caution when using this command. 
<DEVICE>system-view
[DEVICE]#
[DEVICE]interface Ethernet 0/0/1
[DEVICE-Ethernet0/0/1] clear configuration this
Warning[0x40530090]: All configurations of the interface will be cleared, and its state will be shutdown. Continue? [Y/N] :
Running...
Info[0x40530093]: Total 6 command(s) executed, 6 successful, 0 failed.

Instead of:

mmi-mode enable
Warning: Entered machine-to-machine mode. All the commands will be executed without being confirmed. Exercise caution when using this command. 
system-view
#
interface Ethernet 0/0/1
 clear configuration this
Warning[0x40530090]: All configurations of the interface will be cleared, and its state will be shutdown. Continue? [Y/N] :
Running...
Info[0x40530093]: Total 6 command(s) executed, 6 successful, 0 failed.

Yes, there are reasons I need this data:

  • It helps to debug.
  • Having the prompt is more convenient and readable.

Why not provide this feature as an option (e.g., a parameter).

Thanks for your work, Exscript is a nice toolbox.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
knipknapcommented, Aug 29, 2018

Exactly 😃

0reactions
angely-devcommented, Aug 29, 2018

Here is what I tried:

#!/opt/python3.6/bin/python3.6
from Exscript.util.interact import read_login
from Exscript.protocols import SSH2
import sys # >>>>>>>>>> ADDED THIS <<<<<<<<<<

# Login
account = read_login()
conn = SSH2(stdout=sys.stdout) # >>>>>>>>>> ADDED THIS <<<<<<<<<<
conn.connect('DEVICE')
conn.login(account)

# Commands
conn.execute('display current-configuration interface ethernet 0/0/2')

# Logout
conn.send('exit\r')
conn.close()

Now I got the prompt:

$ ./simple.py 
Please enter your user name [champi]: 
Please enter your password: 
<DEVICE>display current-configuration interface ethernet 0/0/2
#
interface Ethernet0/0/2
 description Uplink
 shutdown
#
return

Is this the recommended way to go? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 command to get current display device
Is there any command on Windows 10 that shows the name (or some identification string) of the active monitor on a multi-monitor system?...
Read more >
Device Manager does not display devices that are not ...
Device Manager displays only non-Plug and Play devices, drivers, and printers ... For Windows 7 and earlier: Type the following command a command...
Read more >
How to Access Device Manager From the Command Prompt
The Device Manager run command is handy to know for starting the Device Manager, updating drivers, and more. Enter devmgmt.msc into Command ...
Read more >
How to get a list of all Device Drivers using Command Prompt
This can be a difficult process, which is why we are going to talk about how to view a list of all device...
Read more >
How to Find and List Connected USB Devices in Windows 10
That command will show a list of all present USB devices. "Status OK" means that a device is currently plugged in and works...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found