Changeset 40894 for branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py
- Timestamp:
- Sep 24, 2019, 10:52:39 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py
r40893 r40894 99 99 self.verbose = config.getboolean('atlassian_backups', 'verbose') 100 100 101 self.mysqldump_password = _get_str_key_from_section(config, section, 'mysqldump_password') 102 101 103 def target_backup_paths_ok(self) -> bool: 102 104 copy_paths = [ self.host_backup_path … … 150 152 tar_return = self._tar_attachments() 151 153 154 # mysqldump 155 mysqldump_return = self.make_mysql_dump(self.mysqldump_password) 156 152 157 # If successful: move tmp to old 153 if jira_return == 0 and conf_return == 0 and tar_return == 0 :158 if jira_return == 0 and conf_return == 0 and tar_return == 0 and mysqldump_return == 0: 154 159 _move_dir_contents_to_dir(tmp_paths, old_paths, self.verbose) 155 160 else: … … 252 257 # do this as the dumper user 253 258 259 print(dump_password) 260 254 261 latest_paths = self.target_paths("latest") 255 262 if not self.target_backup_paths_ok(): … … 270 277 , '--databases', 'jiradb', 'confluencedb' 271 278 ] 279 print(mysqldump_args) 272 280 with open(dump_filepath, "w+") as df: 273 281 mysqldump_process = subprocess.Popen(mysqldump_args, stdout=df, stderr=subprocess.PIPE) … … 278 286 if stde is not None: 279 287 decoded_stderr = stde.decode() 288 print(decoded_stderr) 289 print(decoded_stderr.casefold().find('error'.casefold())) 280 290 if decoded_stderr.casefold().find('error'.casefold()) > -1: 281 291 raise sub_utils.SubprocessError()
Note:
See TracChangeset
for help on using the changeset viewer.
