1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3# BAREOS - Backup Archiving REcovery Open Sourced 4# 5# Copyright (C) 2014-2020 Bareos GmbH & Co. KG 6# 7# This program is Free Software; you can redistribute it and/or 8# modify it under the terms of version three of the GNU Affero General Public 9# License as published by the Free Software Foundation, which is 10# listed in the file LICENSE. 11# 12# This program is distributed in the hope that it will be useful, but 13# WITHOUT ANY WARRANTY; without even the implied warranty of 14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15# Affero General Public License for more details. 16# 17# You should have received a copy of the GNU Affero General Public License 18# along with this program; if not, write to the Free Software 19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20# 02110-1301, USA. 21# 22# Author: Maik Aussendorf 23# 24# The BareosFdWrapper module. Here is a global object bareos_fd_plugin_object 25# and wrapper functions, which are directly called out of the bareos-fd. They 26# are intended to pass the call to a method of an object of type 27# BareosFdPluginBaseclass (or derived) 28 29# use this as global plugin object among your python-fd-plugin modules 30bareos_fd_plugin_object = None 31 32 33def parse_plugin_definition(plugindef): 34 return bareos_fd_plugin_object.parse_plugin_definition(plugindef) 35 36 37def handle_plugin_event(event): 38 return bareos_fd_plugin_object.handle_plugin_event(event) 39 40 41def start_backup_file(savepkt): 42 return bareos_fd_plugin_object.start_backup_file(savepkt) 43 44 45def end_backup_file(): 46 return bareos_fd_plugin_object.end_backup_file() 47 48 49def start_restore_file(cmd): 50 return bareos_fd_plugin_object.start_restore_file(cmd) 51 52 53def end_restore_file(): 54 return bareos_fd_plugin_object.end_restore_file() 55 56 57def restore_object_data(ROP): 58 return bareos_fd_plugin_object.restore_object_data(ROP) 59 60 61def plugin_io(IOP): 62 return bareos_fd_plugin_object.plugin_io(IOP) 63 64 65def create_file(restorepkt): 66 return bareos_fd_plugin_object.create_file(restorepkt) 67 68 69def set_file_attributes(restorepkt): 70 return bareos_fd_plugin_object.set_file_attributes(restorepkt) 71 72 73def check_file(fname): 74 return bareos_fd_plugin_object.check_file(fname) 75 76 77def get_acl(acl): 78 return bareos_fd_plugin_object.get_acl(acl) 79 80 81def set_acl(acl): 82 return bareos_fd_plugin_object.set_acl(acl) 83 84 85def get_xattr(xattr): 86 return bareos_fd_plugin_object.get_xattr(xattr) 87 88 89def set_xattr(xattr): 90 return bareos_fd_plugin_object.set_xattr(xattr) 91 92 93def handle_backup_file(savepkt): 94 return bareos_fd_plugin_object.handle_backup_file(savepkt) 95