2

So I have a script that automatically reboots a device:

In run time:

MASTER> reboot

MASTER>

Are you sure you want to reboot (YES|NO):

!!!!!!!!!!

MASTER>

My code:

child.expect('MASTER>')
child.sendline('reboot')


child.expect('MASTER>')
child.expect('Are you sure you want to reboot (YES|NO)')
child.sendline('YES')

Problem:

How to I skip the junk characters "!!!!!!!" that come in between and go to "MASTER>" again?

Right now my code stops functioning after 'YES'

EDIT:

I actually found that the code spawns a new process for the reboot to happen.

Thanks

Community
  • 1
  • 1
Priyanka Iyer
  • 175
  • 1
  • 3
  • 8

0 Answers0