33import subprocess
44import time
55import typing
6+ from typing import Optional
67
78from modules .module import MtcModule
89from mypylib .mypylib import color_print , ip2int , run_as_root , parse
@@ -20,6 +21,8 @@ def create_keyring(self, dir_name: str):
2021 def create_tmp_ton_dir (self ):
2122 result = self .ton .validatorConsole .Run ("getconfig" )
2223 text = parse (result , "---------" , "--------" )
24+ if text is None :
25+ raise Exception ("Could not get config from validator-console" )
2326 dir_name = self .ton .tempDir + f'/ton_backup_{ int (time .time () * 1000 )} '
2427 dir_name_db = dir_name + '/db'
2528 os .makedirs (dir_name_db )
@@ -29,7 +32,7 @@ def create_tmp_ton_dir(self):
2932 return dir_name
3033
3134 @staticmethod
32- def run_create_backup (args , user : str = None ):
35+ def run_create_backup (args , user : Optional [ str ] = None ):
3336 if user is None :
3437 user = get_current_user ()
3538 with get_package_resource_path ('mytonctrl' , 'scripts/create_backup.sh' ) as backup_script_path :
@@ -54,7 +57,7 @@ def create_backup(self, args: list) -> typing.Union[int, None]:
5457 return process .returncode
5558
5659 @staticmethod
57- def run_restore_backup (args , user : str = None ):
60+ def run_restore_backup (args , user : Optional [ str ] = None ):
5861 if user is None :
5962 user = get_current_user ()
6063 with get_package_resource_path ('mytonctrl' , 'scripts/restore_backup.sh' ) as restore_script_path :
0 commit comments