verifyRRD hard coded paths, can miss during -fix_rrd
While testing the upgrade process from v3_2_19 to 3_2_20, I noticed that while service gwms-factory upgrade noticed that there were schema changes to the rrd database and made appropriate changes, it missed upgrading a file. From factory.err.log after upgrade:
[2017-09-05 19:32:03,925] ERROR: glideFactoryMonitoring:173: Failed to update /var/lib/gwms-factory/work-dir/monitor/total/frontend_vofrontend_service_frontend/Status_Attributes.rrd:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/glideinwms/factory/glideFactoryMonitoring.py", line 171, in write_rrd_multi
self.rrd_obj.update_rrd_multi(fname, time, val_dict)
File "/usr/lib/python2.6/site-packages/glideinwms/lib/rrdSupport.py", line 182, in update_rrd_multi
error: unknown DS name 'ReqIdleCores'
Looking at verifyRRD() in factory/glideFactoryMonitorAggregator.py, I see the directory paths that are checked are hard coded and this particular path will not be checked.
Paths are also hardcoded in veryfyRRD() frontend/glideinFrontendMonitorAggregator.py.
If these paths were checked with something like os.walk() the rrd file in the error message would have been upgraded. This would also make one less place in the code that had to be changed if the directory structure is modified for new features.