@@ -258,9 +258,11 @@ def set_ip_address(self, new_ip_address: str):
258258 self .ini_parser .write (file )
259259 #Send the file back to the target BS1200, replacing the entire file
260260 self .send_file ('ni-rt.ini' , 'ni-rt.ini' )
261- #remove local copy of cfg file and update the FTP helper's stored target address
261+ #remove local copy of cfg file
262262 os .remove ('ni-rt.ini' )
263- self .FTP .tgt_address = self .ip_address = new_ip_address
263+
264+ #dont update this until we restart the unit with nisyscfg
265+ #self.FTP.tgt_address = self.ip_address = new_ip_address
264266
265267 def set_tcp_settings (self , ip_address : str ,
266268 cmd_port : int , cmd_interval_ms : int ):
@@ -429,11 +431,16 @@ def __restart_unit(self):
429431 #open a nisyscfg session to the BS1200 to restart it
430432 with nisyscfg .Session (self .ip_address , self .user , self .pwd ) as s :
431433 #updates IP address for the ConfigTools instance to the new IP address once restart complete
432- ev = self .__start_anim (f"Restarting BS1200 ({ self .ip_address } )... " )
433- self .ip_address = s .restart ()
434- ev .set ()
434+ try :
435+ ev = self .__start_anim (f"Restarting BS1200 ({ self .ip_address } )... " )
436+ self .ip_address = s .restart (timeout = 60 * 5 )
437+ except :
438+ print ("Issue while restarting unit" )
439+ finally :
440+ ev .set ()
435441 #do this again just in case
436442 self .FTP .tgt_address = self .ip_address
443+ sys .stdout .flush ()
437444 print ("\r \n " + f"BS1200 at { self .ip_address } is back online" )
438445
439446 def __animate (self , loadingtext : str ):
0 commit comments