summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Reporting/Reports.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2018-10-18 16:30:54 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2018-10-18 16:32:31 +0200
commitdb2a8b0f8965fe22ce67a7e29922ad7d51e898a7 (patch)
tree6f9902db2d9679d4ef2c13fc5c37c29e7c34f239 /src/lib/Bcfg2/Reporting/Reports.py
parent3cf95064ad0f73cb2aeb471387ac8f2e87fe443f (diff)
downloadbcfg2-db2a8b0f8965fe22ce67a7e29922ad7d51e898a7.tar.gz
bcfg2-db2a8b0f8965fe22ce67a7e29922ad7d51e898a7.tar.bz2
bcfg2-db2a8b0f8965fe22ce67a7e29922ad7d51e898a7.zip
Reporting: Set flag when interaction is fully imported
Diffstat (limited to 'src/lib/Bcfg2/Reporting/Reports.py')
-rwxr-xr-xsrc/lib/Bcfg2/Reporting/Reports.py13
1 files changed, 10 insertions, 3 deletions
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: