File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -332,18 +332,26 @@ def Upgrade(ton, args):
332332 else :
333333 text = "Upgrade - {red}Error{endc}"
334334 color_print (text )
335- #end define
336335
337- def rollback_to_mtc1 (ton , args ):
336+
337+ def rollback_to_mtc1 (local , ton , args ):
338338 color_print ("{red}Warning: this is dangerous, please make sure you've backed up mytoncore's db.{endc}" )
339- a = input ("Do you want to continue? [Y/n]" )
339+ a = input ("Do you want to continue? [Y/n]\n " )
340340 if a .lower () != 'y' :
341341 print ('aborted.' )
342342 return
343343 ton .rollback_modes ()
344+
345+ workdir = local .buffer .my_work_dir
346+ version_file_path = os .path .join (workdir , 'VERSION' )
347+ if os .path .exists (version_file_path ):
348+ os .remove (version_file_path )
349+
344350 rollback_script_path = pkg_resources .resource_filename ('mytonctrl' , 'migrations/roll_back_001.sh' )
345351 run_args = ["bash" , rollback_script_path ]
346- exit_code = run_as_root (run_args )
352+ run_as_root (run_args )
353+ local .exit ()
354+
347355
348356def cleanup_validator_db (ton , args ):
349357 cleanup_script_path = pkg_resources .resource_filename ('mytonctrl' , 'scripts/cleanup.sh' )
You can’t perform that action at this time.
0 commit comments