|
From: Bill A. <wa...@pr...> - 2025-02-26 00:18:40
|
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 wa...@pr... |