bareos icon indicating copy to clipboard operation
bareos copied to clipboard

contrib: add pure python statefile parser

Open arogge opened this issue 1 year ago • 5 comments

This PR adds a python module to read Bareos filedaemon statefiles.

Please check

  • [x] Short description and the purpose of this PR is present above this paragraph
  • [x] Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • [x] Is the PR title usable as CHANGELOG entry?
  • [x] Purpose of the PR is understood
  • [x] Commit descriptions are understandable and well formatted ~~Required backport PRs have been created~~
Source code quality
  • [x] Source code changes are understandable
  • [x] Variable and function names are meaningful
  • [x] Code comments are correct (logically and spelling) ~~Required documentation changes are present and part of the PR~~

arogge avatar Apr 23 '24 13:04 arogge

Should we anticipate the usage of that decoding for also bareos-sd ?

bruno-at-bareos avatar Apr 24 '24 09:04 bruno-at-bareos

I haven't tested it, but maybe it just works? The problem with the SD statefile parsing is that looking the last 10 jobs of an SD is usually a lot less useful (just because so much more jobs are running there).

arogge avatar Apr 24 '24 09:04 arogge

I haven't tested it, but maybe it just works? The problem with the SD statefile parsing is that looking the last 10 jobs of an SD is usually a lot less useful (just because so much more jobs are running there).

It just work when the state file in not empty. So good enough for contrib code.

bruno-at-bareos avatar Apr 25 '24 13:04 bruno-at-bareos

We should probably write at least one systemtest for this. Nothing major. A simple backup + read state file and check for consistency should be enough.

sebsura avatar May 14 '24 07:05 sebsura

We should probably write at least one systemtest for this. Nothing major. A simple backup + read state file and check for consistency should be enough.

But if we do that, then this isn't example-code for contrib anymore. Then we should clean it up, make sure it is portable and put it into the scripts directory.

arogge avatar Jun 06 '24 11:06 arogge