- Timestamp:
- Oct 15, 2019, 12:27:24 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/backup.py
r40944 r40945 10 10 import backups.utils.errors as errs 11 11 import backups.utils.subprocess_utils as sub_utils 12 from backups.utils.config_parse_helper import ConfigSchema , ConfigSchemaLine12 from backups.utils.config_parse_helper import ConfigSchemaSection, ConfigSchemaLine 13 13 14 14 DEFAULT_CONFIG_FILE = path.join(path.dirname(__file__), 'atlassian_backups.config') … … 68 68 return self.run_mysqldump 69 69 70 DEFAULT_SCHEMA = ConfigSchema ('DEFAULT',70 DEFAULT_SCHEMA = ConfigSchemaSection('DEFAULT', 71 71 [ ConfigSchemaLine('backup_paths', True, list, cfg_help.SpecialSchemaProcessing.commma_separated) 72 72 , ConfigSchemaLine('source_machine', True, str) … … 76 76 ) 77 77 78 def read_default_section(self, config: ConfigParser, schema: ConfigSchema =DEFAULT_SCHEMA):78 def read_default_section(self, config: ConfigParser, schema: ConfigSchemaSection=DEFAULT_SCHEMA): 79 79 self.default_dict = cfg_help.parse_config(config, schema) 80 80 self.hostname_is_valid() 81 81 self.maybe_make_backup_dirs() 82 82 83 COPY_SCHEMA = ConfigSchema ('COPY',83 COPY_SCHEMA = ConfigSchemaSection('COPY', 84 84 [ ConfigSchemaLine('sources', True, list, cfg_help.SpecialSchemaProcessing.commma_separated) 85 85 , ConfigSchemaLine('additional_args', False, list, cfg_help.SpecialSchemaProcessing.space_separated) … … 87 87 ) 88 88 89 def read_copy_config_section(self, config: ConfigParser, schema: ConfigSchema =COPY_SCHEMA):89 def read_copy_config_section(self, config: ConfigParser, schema: ConfigSchemaSection=COPY_SCHEMA): 90 90 self.copy_dict = cfg_help.parse_config(config, schema) 91 91 92 TAR_SCHEMA = ConfigSchema ('TAR',92 TAR_SCHEMA = ConfigSchemaSection('TAR', 93 93 [ ConfigSchemaLine('sources', True, list, cfg_help.SpecialSchemaProcessing.commma_separated) 94 94 , ConfigSchemaLine('additional_args', False, list, cfg_help.SpecialSchemaProcessing.space_separated) … … 98 98 ) 99 99 100 def read_tar_config_section(self, config: ConfigParser, schema: ConfigSchema =TAR_SCHEMA):100 def read_tar_config_section(self, config: ConfigParser, schema: ConfigSchemaSection=TAR_SCHEMA): 101 101 self.tar_dict = cfg_help.parse_config(config, schema) 102 102 103 RSYNC_SCHEMA = ConfigSchema ('RSYNC',103 RSYNC_SCHEMA = ConfigSchemaSection('RSYNC', 104 104 [ ConfigSchemaLine('sources', True, list, cfg_help.SpecialSchemaProcessing.commma_separated) 105 105 , ConfigSchemaLine('additional_args', False, list, cfg_help.SpecialSchemaProcessing.space_separated) … … 107 107 ) 108 108 109 def read_rsync_config_section(self, config: ConfigParser, schema: ConfigSchema =RSYNC_SCHEMA):109 def read_rsync_config_section(self, config: ConfigParser, schema: ConfigSchemaSection=RSYNC_SCHEMA): 110 110 self.rsync_dict = cfg_help.parse_config(config, schema) 111 111 112 MYSQLDUMP_SCHEMA = ConfigSchema ('MYSQLDUMP',112 MYSQLDUMP_SCHEMA = ConfigSchemaSection('MYSQLDUMP', 113 113 [ ConfigSchemaLine('user', True, str) 114 114 , ConfigSchemaLine('password', True, str) … … 120 120 ) 121 121 122 def read_mysqldump_config_section(self, config: ConfigParser, schema: ConfigSchema =MYSQLDUMP_SCHEMA):122 def read_mysqldump_config_section(self, config: ConfigParser, schema: ConfigSchemaSection=MYSQLDUMP_SCHEMA): 123 123 self.mysqldump_dict = cfg_help.parse_config(config, schema) 124 124
Note:
See TracChangeset
for help on using the changeset viewer.
