From a1dac9a652cf309bfa16b6495c820d2fe508bc50 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 18 Oct 2018 16:30:54 +0200 Subject: Reporting: Set flag when interaction is fully imported --- src/lib/Bcfg2/Reporting/Reports.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/lib/Bcfg2/Reporting/Reports.py') diff --git a/src/lib/Bcfg2/Reporting/Reports.py b/src/lib/Bcfg2/Reporting/Reports.py index e60b2e82e..7e1661c5a 100755 --- a/src/lib/Bcfg2/Reporting/Reports.py +++ b/src/lib/Bcfg2/Reporting/Reports.py @@ -17,7 +17,7 @@ def print_entries(interaction, etype): class _FlagsFilterMixin(object): """ Mixin that allows to filter the interactions based on the - only_important and/or the dry_run flag """ + only_important, the dry_run and/or the ready flag """ options = [ Bcfg2.Options.BooleanOption( @@ -27,10 +27,15 @@ class _FlagsFilterMixin(object): Bcfg2.Options.BooleanOption( "-i", "--no-only-important", help="Do not consider interactions created with the " - "--only-important flag")] + "--only-important flag"), + Bcfg2.Options.BooleanOption( + "-r", "--ready", + help="Only consider interactions fully imported into the " + "database")] def get_interaction(self, client, setup): - if not setup.no_dry_run and not setup.no_only_important: + if not setup.no_dry_run and not setup.no_only_important \ + and not setup.ready: return client.current_interaction filter = {} @@ -38,6 +43,8 @@ class _FlagsFilterMixin(object): filter['dry_run'] = False if setup.no_only_important: filter['only_important'] = False + if setup.ready: + filter['ready'] = True from Bcfg2.Reporting.models import Interaction try: -- cgit v1.2.3-1-g7c22