Changeset 40913
- Timestamp:
- Oct 7, 2019, 1:25:05 PM (7 years ago)
- Location:
- branches/ipp-259_genericise_backups/tools/backups
- Files:
-
- 4 edited
-
backup_atlassian_applications.py (modified) (5 diffs)
-
backup_atlassian_applications_test.py (modified) (2 diffs)
-
full_atlassian_backup_test.py (modified) (1 diff)
-
utils/subprocess_utils.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications.py
r40912 r40913 79 79 ] 80 80 81 def perform_ atlassian_backups(self):81 def perform_backups(self): 82 82 83 83 # Check all paths are ok first: … … 92 92 gen_utils.move_dirs(latest_paths, tmp_paths, self.verbose) 93 93 94 return_status = [] 95 96 # copy jira 97 return_status.append(self._copy_jira_backup(self.verbose)) 98 99 # copy confluence 100 return_status.append(self._copy_confluence_backup(self.verbose)) 101 102 # tarfiles: 103 return_status.append(self._tar_jira_attachments()) 104 return_status.append(self._tar_conf_attachments()) 105 106 # mysqldump 107 return_status.append(self.make_mysql_dump(self.mysqldump_password)) 94 return_status = self._jira_backups() 95 return_status = return_status + self._conf_backups() 96 return_status = return_status + self._db_dump() 108 97 109 98 # If successful: move tmp to old … … 119 108 120 109 return 0 110 111 def _jira_backups(self): 112 return_status = [] 113 return_status.append(self._copy_jira_backup(self.verbose)) 114 return_status.append(self._tar_jira_attachments()) 115 return return_status 116 117 def _conf_backups(self): 118 return_status = [] 119 return_status.append(self._copy_confluence_backup(self.verbose)) 120 return_status.append(self._tar_conf_attachments()) 121 return return_status 122 123 def _db_dump(self): 124 return [self.make_mysql_dump(self.mysqldump_password)] 121 125 122 126 def get_jira_backup_date_format(self, custom_date=None): … … 197 201 return 0 198 202 199 200 203 def _tar_conf_attachments(self): 201 204 latest_paths = self.target_paths("latest") … … 261 264 262 265 def run(self): 263 return self.perform_ atlassian_backups()266 return self.perform_backups() 264 267 265 268 -
branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications_test.py
r40912 r40913 335 335 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 336 336 337 result = ab.perform_ atlassian_backups()337 result = ab.perform_backups() 338 338 339 339 assert result == 0 … … 353 353 assert not os.path.exists(ab.backup_2_path) 354 354 355 result = ab.perform_ atlassian_backups()355 result = ab.perform_backups() 356 356 assert result == 1 357 357 -
branches/ipp-259_genericise_backups/tools/backups/full_atlassian_backup_test.py
r40897 r40913 142 142 ab = create_all_paths_and_folders(ab, tmpdir) 143 143 144 result = ab.perform_ atlassian_backups()144 result = ab.perform_backups() 145 145 146 146 assert result == 0 -
branches/ipp-259_genericise_backups/tools/backups/utils/subprocess_utils.py
r40898 r40913 42 42 43 43 try: 44 subprocess .check_call(command_and_args)44 subprocess_exitcode = subprocess.check_call(command_and_args) 45 45 except (subprocess.CalledProcessError) as cpe: 46 46 raise SubprocessError(f"{type(cpe)} in python simple_unix_wrapper") from cpe 47 47 except (ValidationError) as ve: 48 48 raise ValidationError(f"{type(ve)} in python simple_unix_wrapper") from ve 49 return 049 return subprocess_exitcode
Note:
See TracChangeset
for help on using the changeset viewer.
