def open_xb_stdout(self): """Open the stdout output for a streaming xtrabackup run""" config = self.config["xtrabackup"] backup_directory = self.target_directory stream = util.determine_stream_method(config["stream"]) if stream: if stream == "tar": archive_path = join(backup_directory, "backup.tar") elif stream == "xbstream": archive_path = join(backup_directory, "backup.xb") else: raise BackupError("Unknown stream method '%s'" % stream) zconfig = self.config["compression"] try: return open_stream( archive_path, "w", method=zconfig["method"], level=zconfig["level"], extra_args=zconfig["options"], inline=zconfig["inline"], ) except OSError as exc: raise BackupError("Unable to create output file: %s" % exc) else: return open("/dev/null", "w")
def open_xb_stdout(self): """Open the stdout output for a streaming xtrabackup run""" config = self.config["xtrabackup"] backup_directory = self.target_directory stream = util.determine_stream_method(config["stream"]) if stream: # XXX: bounce through compression if stream == "tar": archive_path = join(backup_directory, "backup.tar") zconfig = self.config["compression"] try: return open_stream( archive_path, "w", method=zconfig["method"], level=zconfig["level"], extra_args=zconfig["options"], ) except OSError, exc: raise BackupError("Unable to create output file: %s" % exc) elif stream == "xbstream": archive_path = join(backup_directory, "backup.xb") return open(archive_path, "w") else: raise BackupError("Unknown stream method '%s'" % stream)
def open_xb_stdout(self): """Open the stdout output for a streaming xtrabackup run""" config = self.config["xtrabackup"] backup_directory = self.target_directory stream = util.determine_stream_method(config["stream"]) if stream: if stream == "tar": archive_path = join(backup_directory, "backup.tar") elif stream == "xbstream": archive_path = join(backup_directory, "backup.xb") else: raise BackupError("Unknown stream method '%s'" % stream) try: return open_stream(archive_path, "w", **self.config["compression"]) except OSError as exc: raise BackupError("Unable to create output file: %s" % exc) else: return open("/dev/null", "w")
def open_xb_stdout(self): """Open the stdout output for a streaming xtrabackup run""" config = self.config['xtrabackup'] backup_directory = self.target_directory stream = util.determine_stream_method(config['stream']) if stream: if stream == 'tar': archive_path = join(backup_directory, 'backup.tar') elif stream == 'xbstream': archive_path = join(backup_directory, 'backup.xb') else: raise BackupError("Unknown stream method '%s'" % stream) zconfig = self.config['compression'] try: return open_stream(archive_path, 'w', method=zconfig['method'], level=zconfig['level'], extra_args=zconfig['options']) except OSError, exc: raise BackupError("Unable to create output file: %s" % exc)
def open_xb_stdout(self): """Open the stdout output for a streaming xtrabackup run""" config = self.config['xtrabackup'] backup_directory = self.target_directory stream = util.determine_stream_method(config['stream']) if stream: # XXX: bounce through compression if stream == 'tar': archive_path = join(backup_directory, 'backup.tar') zconfig = self.config['compression'] return open_stream(archive_path, 'w', method=zconfig['method'], level=zconfig['level']) elif stream == 'xbstream': archive_path = join(backup_directory, 'backup.xb') return open(archive_path, 'w') else: raise BackupError("Unknown stream method '%s'" % stream) else: return open('/dev/null', 'w')