Bug 853282 - [RFE] add --limit to log-delete
[RFE] add --limit to log-delete
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: scheduler (Show other bugs)
0.9
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.9.4
: ---
Assigned To: Raymond Mancy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-30 20:36 EDT by Bill Peck
Modified: 2014-12-07 20:13 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-11 19:43:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill Peck 2012-08-30 20:36:18 EDT
Description of problem:
If we get really behind in deleting logs we may need to do it in chunks.  Please add a limit option to log-delete which then limits the query on the scheduler side as well.

Version-Release number of selected component (if applicable):
0.9.2
Comment 2 Raymond Mancy 2012-08-31 01:50:16 EDT
http://gerrit.beaker-project.org/#/c/1313/
Comment 6 Dan Callaghan 2012-10-02 02:13:02 EDT
In my development environment:

# log-delete --dry-run -v --debug --limit 1
2012-10-02 16:12:26,511 bkr.server.tools.log_delete INFO Dry run only
2012-10-02 16:12:26,511 bkr.server.tools.log_delete INFO Getting expired jobs
Traceback (most recent call last):
  File "/usr/bin/log-delete", line 9, in <module>
    load_entry_point('bkr.server==0.9.4', 'console_scripts', 'log-delete')()
  File "/usr/lib/python2.6/site-packages/bkr/server/tools/log_delete.py", line 44, in main
    return log_delete(options.verbose, options.dry_run, options.limit)
  File "/usr/lib/python2.6/site-packages/bkr/server/tools/log_delete.py", line 55, in log_delete
    for job, logs in Job.expired_logs(limit):
  File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 3660, in expired_logs
    job_ids = job_ids[:limit]
TypeError: slice indices must be integers or None or have an __index__ method
Comment 7 Raymond Mancy 2012-10-03 09:42:55 EDT
http://gerrit.beaker-project.org/#/c/1400/

Note You need to log in before you can comment on or make changes to this bug.