From 10eb57597eecdb42e931a5f817af58b508e2fff9 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Fri, 27 Apr 2012 18:51:15 -0500 Subject: DBStats: Add unpruned entry reporting (#659) Path type='directory' entries previously had no 'reason' associated with their 'dirty' state. This change adds a database field for unpruned entries which are present in a pruned directory and displays that list in the web reporting interface. There is also a change made to the POSIX client tool which forces it to display the extra entry list when running in interactive mode without debugging enabled. Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Server/Reports/importscript.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Server/Reports/importscript.py') diff --git a/src/lib/Bcfg2/Server/Reports/importscript.py b/src/lib/Bcfg2/Server/Reports/importscript.py index ea89c70cd..16df86a9b 100755 --- a/src/lib/Bcfg2/Server/Reports/importscript.py +++ b/src/lib/Bcfg2/Server/Reports/importscript.py @@ -40,6 +40,7 @@ from Bcfg2.Bcfg2Py3k import ConfigParser def build_reason_kwargs(r_ent, encoding, logger): binary_file = False sensitive_file = False + unpruned_entries = '' if r_ent.get('sensitive') in ['true', 'True']: sensitive_file = True rc_diff = '' @@ -57,6 +58,10 @@ def build_reason_kwargs(r_ent, encoding, logger): rc_diff = r_ent.get('current_diff') else: rc_diff = '' + # detect unmanaged entries in pruned directories + if r_ent.get('prune', 'false') == 'true' and r_ent.get('qtest'): + unpruned_elist = [e.get('path') for e in r_ent.findall('Prune')] + unpruned_entries = "\n".join(unpruned_elist) if not binary_file: try: rc_diff = rc_diff.decode(encoding) @@ -78,7 +83,8 @@ def build_reason_kwargs(r_ent, encoding, logger): current_exists=r_ent.get('current_exists', default="True").capitalize() == "True", current_diff=rc_diff, is_binary=binary_file, - is_sensitive=sensitive_file) + is_sensitive=sensitive_file, + unpruned=unpruned_entries) def load_stats(cdata, sdata, encoding, vlevel, logger, quick=False, location=''): -- cgit v1.2.3-1-g7c22