bareos: playground f21b64f7

Author Committer Branch Timestamp Parent
Marco van Wieringen Marco van Wieringen playground 2014-04-05 10:10 playground ec429d14 Pending
Changeset Implement some missing functionality in python-fd plugin.

- Implement bEventHandleBackupFile event.

  Implemented the missing code for handling the bEventHandleBackupFile event
  by calling a new entry point (handle_backup_file) in the python module and
  passing it in a savepacket structure with the file being processed. The
  return codes are also fixed along the way things work now like this:

  - bRC_OK: Options plugin will do backup e.g. call IOmethod in plugin.
  - bRC_Skip: Options plugin want to skip the backup of this file.
  - bRC_Core: Options plugin want the Bareos core to do the backup of the file.
  - bRC_*: Error abort backing up.

- Implement check_file() method.

  Implemented the missing code for handling the check_file() method by calling
  a new entry point (check_file) in the python module and passing it the filename
  of the file currently being processed.

- Implement create_file() method.

  Allow a python script to do everything a normal C-plugin can also do
  in the create_file() plugin method. For this we needed to implement the
  RestorePacket structure in Python and create a dummy create_file method
  in python that returns CF_EXTRACT in the create_status field of the
  restore_packet structure.

- Implement event filtering for certain events.

  Some events get generated via a different code path and were up until
  now not filtered using the is_event_enabled() function. Added support
  to the following functions:

  - plugin_option_handle_file()
  - plugin_save()
  - plugin_estimate()
  - plugin_name_stream()

  Also refactored the code along the way.
mod - src/filed/backup.c Diff File
mod - src/filed/fd_plugins.c Diff File
mod - src/plugins/filed/bareos-fd.py Diff File
mod - src/plugins/filed/python-fd.c Diff File
mod - src/plugins/filed/python-fd.h Diff File