I like the feature of "clean_content_views" to delete unused CVs keeping a specified number of backups.
By default this works for versions before the first one promoted (except if you use "--cleanall", that isn't what I need).
Usually in our environment we need to delete versions among different promoted ones but keeping some of them:
To obtain it I added a new parameter "--ignorefirstpromoted" to start counting from the first version available rgardless the promoted one. For instance if I set "keep: 1" versions 2.0 and 4.0 will be deleted and 5.0 will my backup.
Looks like a good idea... When I test this running with the original "-a" flag though I am getting a TypeError at line 127:
Traceback (most recent call last):
File "/usr/local/bin/clean_content_views", line 7, in
clean_content_views.main(sys.argv[1:])
File "/usr/share/sat6_scripts/clean_content_views.py", line 278, in main
cleanup(ver_list, ver_descr, dry_run, runuser, ver_keep, cleanall, ignorefirstpromoted)
File "/usr/share/sat6_scripts/clean_content_views.py", line 127, in cleanup
todelete = version_list_all[:(len(version_list_all) - ver_keep[cvid])]
TypeError: unsupported operand type(s) for -: 'int' and 'str'
Hello,
I like the feature of "clean_content_views" to delete unused CVs keeping a specified number of backups. By default this works for versions before the first one promoted (except if you use "--cleanall", that isn't what I need). Usually in our environment we need to delete versions among different promoted ones but keeping some of them:
To obtain it I added a new parameter "--ignorefirstpromoted" to start counting from the first version available rgardless the promoted one. For instance if I set "keep: 1" versions 2.0 and 4.0 will be deleted and 5.0 will my backup.