File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,20 +152,26 @@ def _await_prompt(self):
152152 enter the password.
153153 """
154154 self .console .expect (self .boot_expression , timeout = self .login_timeout )
155- index , _ , _ , _ = self .console .expect (
156- [self .prompt , self .autoboot , self .password_prompt ]
157- )
158- if index == 0 :
159- self ._status = 1
160- elif index == 2 :
161- if self .password :
162- self .console .sendline (self .password )
163- self ._check_prompt ()
164- else :
165- raise Exception ("Password entry needed but no password set" )
166- else :
167- self .console .write (self .interrupt .encode ('ASCII' ))
155+ while True :
156+ index , _ , _ , _ = self .console .expect (
157+ [self .prompt , self .autoboot , self .password_prompt ]
158+ )
159+ if index == 0 :
160+ self ._status = 1
161+ break
162+
163+ elif index == 1 :
164+ self .console .write (self .interrupt .encode ('ASCII' ))
165+
166+ elif index == 2 :
167+ if self .password :
168+ self .console .sendline (self .password )
169+ else :
170+ raise Exception ("Password entry needed but no password set" )
171+
172+ if self .prompt :
168173 self ._check_prompt ()
174+
169175 for command in self .init_commands : #pylint: disable=not-an-iterable
170176 self ._run_check (command )
171177
You can’t perform that action at this time.
0 commit comments