From b0d6628d46fee8e694944db18d62855d91eee88b Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 16 Dec 2014 10:05:14 -0500 Subject: [PATCH] Add some stdout to the activity stream cleanup command --- awx/main/management/commands/cleanup_activitystream.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/management/commands/cleanup_activitystream.py b/awx/main/management/commands/cleanup_activitystream.py index c8f65ba5fb..7b8fb8cf82 100644 --- a/awx/main/management/commands/cleanup_activitystream.py +++ b/awx/main/management/commands/cleanup_activitystream.py @@ -41,6 +41,7 @@ class Command(NoArgsCommand): self.logger.propagate = False def cleanup_activitystream(self): + n_deleted_items = 0 for asobj in ActivityStream.objects.all(): asobj_disp = '"%s" id: %s' % (unicode(asobj), asobj.id) if asobj.timestamp >= self.cutoff: @@ -51,6 +52,8 @@ class Command(NoArgsCommand): self.logger.info("would delete %s" % asobj_disp) if not self.dry_run: asobj.delete() + n_deleted_items += 1 + print("Removed %s items" % str(n_deleted_items)) def handle_noargs(self, **options): self.verbosity = int(options.get('verbosity', 1))