Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to cleanup and keep versions among promoted ones #26

Merged

Conversation

camandel
Copy link
Contributor

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:

v7.0 Library
v6.0 dev
v5.0  
v4.0 
v3.0 prod
v2.0
v1.0 goldenimg

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.

@ggatward
Copy link
Collaborator

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'

@ggatward ggatward merged commit ade9891 into RedHatSatellite:master Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants