cancel
Showing results for 
Search instead for 
Did you mean: 

How to answer Yes and No question using paramiko (scripting)

How to answer Yes and No question using paramiko (scripting)

Elegua
New Contributor

I need to save configuration on switch extreme. The command is :

save configuration "File Name"

After of command's execution i need to answer 2 question.

First:

Do you want to save configuration ? (y/N) -> I have to say Yes

Second:

Do you want to make "File Name".cfg the default database? (y/N) -> I have to say No

I am using paramiko for command execution.

Below is a piece of my code:

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(server, username=username, password=password)
stdin, stdout, stderr = ssh.exec_command('save configuration '+ backupFileName)
#Now i need to say first Yes and then NO

Someone could help me?

Thanks

1 REPLY 1

Stephane_Grosj1
Extreme Employee

Hi,

 

I never used paramiko, but if you happen to have XMC, you should consider porting your script to it. XMC would take care of all of that for you and you could more easily manage these questions.

GTM-P2G8KFN