Re: baculabackupreport ini variable quoting issue

Bill Arlofski via Bacula-users <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
On 2/25/25 5:05 PM, Rob Gerber wrote:
> Bill, I'm adopting your baculabackupreport python script and I've found some strange behavior.
> 
> I have copy and pasted some variables from the script into the ini file. I didn't change many of the ones I pasted in, I more 
> wanted to 'bookmark' them by putting them in the ini file so I could find them easily later if I decided to experiment with 
> them.
> 
> The trouble I've encountered a couple times now is that sometimes the script doesn't like the variables as originally quoted 
> in the script.
> 
> For example, I copied over this variable, exactly as you see it here:
> alwaysfailcolumn = 'jobname'    # Column to colorize for "always failing jobs" (column name, row, none)
> 
> But now the previously correctly working script says this:
> 
> [bacula@td-bacula baculabackupreport]$ /opt/baculabackupreport/email_daily.sh
> - Reading configuration overrides from config file '/opt/baculabackupreport/my.ini', section 'DEFAULT' (if exists), and 
> section 'Daily'
> 
> The 'alwaysfailcolumn' name ''jobname'' not valid or not in cols2show.
> 
> It looks like the script handles the single quoted variables fine when they're in the script itself, but tries to add them 
> when the variable is in the ini. The trouble goes away if I remove the single quote marks.

Hello Rob,

Yes, this is the normal way the Python configparser module works with these standard "ini" files.

Take a look at the example baculabackupreport.ini file in the repository.

Specifically, look at the `cols2show` examples with multiple entries (all completely unquoted), and then the rest of the 
single entry variables - they are all unquoted.


Hope this helps,
Bill

-- 
Bill Arlofski
[email protected]

_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users
signature.asc (application/pgp-signature, 583 B)
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wsCpBAEBCABdBYJnvl3PCZBIDTDab9XDQDUUAAAAAAAcABBzYWx0QG5vdGF0
aW9ucy5vcGVucGdwanMub3Jnlmnjz8PE28tRhN3X2r/2KBYhBMuLnlBaSQiu
SUbb6UgNMNpv1cNAAAB+UAf8DQ3156qWw9Hl40b13H9qWL9BJs4Q/yOovv4f
v0et4wyMWpmjC2AuE9M4DiXhPm7kMTJJXsniKDNSDulUbQ/b8R5MPt2gGYA2
e1UwNzJE5Gumdk+EKFKTcRFbfRPKEftG4IjZ1e2sDerpzKHNnvo2rUjf6x9+
x5VLpEij8ophI9glKezqFiWgz3n81gaesox69t2aZJA06v5l7DWz1YaromOd
QlQScMMYlN2dz1puIu1QVxRKljTvGIw64WQeJWR0ZN3g9Bo9tW3BiryDERMU
0SowKI6YgkOuAOiQxa75og/TicJaLusaK10z7xakxqa0Tq5n9rnx5YLUYIty
eJaSLw==
=l6W9
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.