This repository was archived by the owner on Feb 1, 2024. It is now read-only.
File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def __init__(self,
69
69
70
70
def reset (self ):
71
71
self .sendline ('reboot' )
72
- self .expect (['going down' ,'disconnected' ])
72
+ self .expect (['going down' ,'disconnected' , 'closed' ])
73
73
try :
74
74
self .expect (self .prompt , timeout = 10 )
75
75
except :
@@ -79,14 +79,16 @@ def reset(self):
79
79
try :
80
80
pexpect .spawn ('ping -w 1 -c 1 ' + self .name ).expect ('64 bytes' , timeout = 1 )
81
81
except :
82
- print (self .name + " not up yet, after %s seconds." % (i + 15 ))
82
+ time .sleep (1 )
83
+ print (self .name + " not up yet, after %s tries." % (i ))
83
84
else :
84
- print ("%s is back after %s seconds , waiting for network daemons to spawn." % (self .name , i + 14 ))
85
+ print ("%s is back after %s tries , waiting for network daemons to spawn." % (self .name , i ))
85
86
time .sleep (15 )
86
87
break
87
88
self .__init__ (self .name , self .color ,
88
- self .output , self . username ,
89
+ self .username ,
89
90
self .password , self .port ,
91
+ output = self .output ,
90
92
reboot = False )
91
93
92
94
def get_ip_addr (self , interface ):
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def __init__(self,
76
76
77
77
def reset (self ):
78
78
self .sendline ('sudo reboot' )
79
- self .expect (['going down' ,'disconnected' ])
79
+ self .expect (['going down' ,'disconnected' , 'closed' ])
80
80
try :
81
81
self .expect (self .prompt , timeout = 10 )
82
82
except :
@@ -86,14 +86,16 @@ def reset(self):
86
86
try :
87
87
pexpect .spawn ('ping -w 1 -c 1 ' + self .name ).expect ('64 bytes' , timeout = 1 )
88
88
except :
89
- print (self .name + " not up yet, after %s seconds." % (i + 15 ))
89
+ time .sleep (1 )
90
+ print (self .name + " not up yet, after %s tries." % (i ))
90
91
else :
91
- print ("%s is back after %s seconds , waiting for network daemons to spawn." % (self .name , i + 14 ))
92
+ print ("%s is back after %s tries , waiting for network daemons to spawn." % (self .name , i ))
92
93
time .sleep (15 )
93
94
break
94
95
self .__init__ (self .name , self .color ,
95
- self .output , self . username ,
96
+ self .username ,
96
97
self .password , self .port ,
98
+ output = self .output ,
97
99
reboot = False )
98
100
99
101
def get_ip_addr (self , interface ):
You can’t perform that action at this time.
0 commit comments