Skip to content

Commit

Permalink
Merge ed31769 into 23adc83
Browse files Browse the repository at this point in the history
  • Loading branch information
np5 committed Jul 3, 2024
2 parents 23adc83 + ed31769 commit 2efa5bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests/inventory/test_management_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ def test_cleanup_inventory_history(self):
self.assertIn('min date', result)
self.assertIn('machine_snapshot_commit', result)

def test_cleanup_inventory_history_quiet(self):
def test_cleanup_inventory_history_quiet_legacy(self):
out = StringIO()
call_command('cleanup_inventory_history', '-q', stdout=out)
self.assertEqual("", out.getvalue())

def test_cleanup_inventory_history_v_0(self):
out = StringIO()
call_command('cleanup_inventory_history', '-v', '0', stdout=out)
self.assertEqual("", out.getvalue())
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def add_arguments(self, parser):
)

def set_options(self, **options):
self.quiet = options.get("quiet", False)
self.quiet = options["quiet"] or options["verbosity"] == 0
self.min_date = get_min_date(options["days"])
if not self.quiet:
self.stdout.write("min date: {}".format(self.min_date.isoformat()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from base.notifier import notifier
from zentral.contrib.monolith.models import Repository
from zentral.contrib.monolith.repository_backends import load_repository_backend
from zentral.core.queues import queues


class Command(BaseCommand):
Expand All @@ -29,3 +30,4 @@ def notify():
notifier.send_notification("monolith.repository", str(db_repository.pk))

transaction.on_commit(notify)
queues.stop()

0 comments on commit 2efa5bf

Please sign in to comment.