- Timestamp:
- Oct 18, 2019, 10:35:56 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/confluence_backup.py
r40944 r40949 4 4 import os.path as path 5 5 6 import backups.backup as bck 6 7 import backups.utils.subprocess_utils as sub_utils 7 8 import backups.utils.errors as errs 8 9 from backups.backup import Backup 10 from backups.utils.config_parse_helper import ConfigSchema 9 11 10 12 EXPECTED_CONFIG_FILE = path.join(path.dirname(__file__), './confluence_backup.config') 13 14 CONFLUENCE_SCHEMA = bck.get_backup_schema() 15 16 17 def make_confluence_schema(): 18 schema = ConfigSchema(None) 19 schema.add_section(bck.DEFAULT_SCHEMA_SECTION) 20 schema.add_section(bck.COPY_SCHEMA_SECTION) 21 schema.add_section(bck.TAR_SCHEMA_SECTION) 22 schema.add_section(bck.MYSQLDUMP_SCHEMA_SECTION) 23 return schema 11 24 12 25 13 26 class ConfluenceBackup(Backup): 14 27 15 def __init__(self, config_file=EXPECTED_CONFIG_FILE): 16 self.load_config(config_file) 28 def __init__(self, config_file=EXPECTED_CONFIG_FILE, schema=None): 29 if schema is None: 30 schema = make_confluence_schema() 31 self.load_config(config_file, schema) 17 32 18 33 @staticmethod … … 25 40 26 41 def _run_copy(self, verbose=False): 27 if self. run_copy is None or False:42 if self.should_run_copy is None or False: 28 43 return 0 29 44
Note:
See TracChangeset
for help on using the changeset viewer.
