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

bug: include delete_service_data & delete_user_record with force #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tokenserver/scripts/purge_old_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,25 @@ def purge_old_records(config_file, grace_period=-1, max_per_loop=10,
backend.delete_user_record(service, row.uid)
elif not row.downed:
logger.info("Purging uid %s on %s", row.uid, row.node)
delete_service_data(config, service, row,
timeout=request_timeout,
settings=settings)
if settings and not settings.dryrun:
delete_service_data(config, service, row,
timeout=request_timeout,
settings=settings)
backend.delete_user_record(service, row.uid)
counter += 1
elif row.downed and settings and settings.force:
elif settings and settings.force:
logger.info(
"Forcing tokenserver record delete: {}".format(
row.uid
)
)
logger.info("Forcing Purge uid %s on %s",
row.uid,
row.node)
if not settings.dryrun:
delete_service_data(config, service, row,
timeout=request_timeout,
settings=settings)
backend.delete_user_record(service, row.uid)
counter += 1
if settings and settings.max_records:
Expand Down