IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40913


Ignore:
Timestamp:
Oct 7, 2019, 1:25:05 PM (7 years ago)
Author:
fairlamb
Message:

separate out jira and confluence from the main call

Location:
branches/ipp-259_genericise_backups/tools/backups
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications.py

    r40912 r40913  
    7979               ]
    8080
    81     def perform_atlassian_backups(self):
     81    def perform_backups(self):
    8282
    8383        # Check all paths are ok first:
     
    9292        gen_utils.move_dirs(latest_paths, tmp_paths, self.verbose)
    9393
    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()
    10897
    10998        # If successful: move tmp to old
     
    119108
    120109        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)]
    121125
    122126    def get_jira_backup_date_format(self, custom_date=None):
     
    197201        return 0
    198202
    199 
    200203    def _tar_conf_attachments(self):
    201204        latest_paths = self.target_paths("latest")
     
    261264
    262265    def run(self):
    263         return self.perform_atlassian_backups()
     266        return self.perform_backups()
    264267
    265268
  • branches/ipp-259_genericise_backups/tools/backups/backup_atlassian_applications_test.py

    r40912 r40913  
    335335        ab = fab_test.create_all_paths_and_folders(ab, tmpdir)
    336336
    337         result = ab.perform_atlassian_backups()
     337        result = ab.perform_backups()
    338338
    339339        assert result == 0
     
    353353        assert not os.path.exists(ab.backup_2_path)
    354354
    355         result = ab.perform_atlassian_backups()
     355        result = ab.perform_backups()
    356356        assert result == 1
    357357
  • branches/ipp-259_genericise_backups/tools/backups/full_atlassian_backup_test.py

    r40897 r40913  
    142142        ab = create_all_paths_and_folders(ab, tmpdir)
    143143
    144         result = ab.perform_atlassian_backups()
     144        result = ab.perform_backups()
    145145
    146146        assert result == 0
  • branches/ipp-259_genericise_backups/tools/backups/utils/subprocess_utils.py

    r40898 r40913  
    4242
    4343    try:
    44         subprocess.check_call(command_and_args)
     44        subprocess_exitcode = subprocess.check_call(command_and_args)
    4545    except (subprocess.CalledProcessError) as cpe:
    4646        raise SubprocessError(f"{type(cpe)} in python simple_unix_wrapper") from cpe
    4747    except (ValidationError) as ve:
    4848        raise ValidationError(f"{type(ve)} in python simple_unix_wrapper") from ve
    49     return 0
     49    return subprocess_exitcode
Note: See TracChangeset for help on using the changeset viewer.