1- from __future__ import print_function
2-
31import logging
42import logging .config
53import sys
@@ -79,7 +77,7 @@ def audit():
7977
8078def _print_audit_report (results , verbose ):
8179 fail = False
82- for key , values in list ( results .items () ):
80+ for key , values in results .items ():
8381 present , absent = values
8482 fail = fail or present or absent
8583
@@ -88,30 +86,33 @@ def _print_audit_report(results, verbose):
8886 else :
8987 print ("WARNING - audit script detected something is wrong." )
9088
91- print ("\n Summary" )
92- print ("=======\n " )
89+ print ()
90+ print ("Summary" )
91+ print ("=======" )
92+ print ()
9393
94- for key , values in list ( results .items () ):
94+ for key , values in results .items ():
9595 present , absent = values
9696 if not present and not absent :
97- print (( "- [x]" , key ) )
97+ print (f "- [x] { key } " )
9898 else :
99- print (( "- [!]" , key ) )
100- print (( " " , len (present ), " extra entries in PDC unaccounted for") )
101- print (( " " , len (absent ), " entries absent from PDC") )
99+ print (f "- [!] { key } " )
100+ print (f " { len (present )} extra entries in PDC unaccounted for" )
101+ print (f " { len (absent )} entries absent from PDC" )
102102
103- print ("\n Details" )
103+ print ()
104+ print ("Details" )
104105 print ("=======" )
105106
106107 limit = 100
107- for key , values in list ( results .items () ):
108+ for key , values in results .items ():
108109 present , absent = values
109110 if not present and not absent :
110111 continue
111112
112113 print ()
113114 print (key )
114- print (( "-" * len (key ) ))
115+ print ("-" * len (key ))
115116 print ()
116117
117118 if not present :
@@ -121,16 +122,16 @@ def _print_audit_report(results, verbose):
121122 print ()
122123 if verbose or len (present ) < limit :
123124 for value in present :
124- print (( "-" , value ) )
125+ print (f"- { value } " )
125126 if isinstance (present , dict ):
126- print (( " " , present [value ]) )
127+ print (f" { present [value ]} " )
127128 else :
128129 present = list (present )
129130 for value in present [:limit ]:
130- print (( "-" , value ) )
131+ print (f"- { value } " )
131132 if isinstance (present , dict ):
132- print (( " " , present [value ]) )
133- print (( "- (plus %i more... truncated.)" % ( len ( present ) - limit )) )
133+ print (f" { present [value ]} " )
134+ print (f "- (plus { len ( present ) - limit } more... truncated.)" )
134135 print ()
135136
136137 if not absent :
@@ -140,16 +141,16 @@ def _print_audit_report(results, verbose):
140141 print ()
141142 if verbose or len (absent ) < limit :
142143 for value in absent :
143- print ("-" , value )
144+ print (f"- { value } " )
144145 if isinstance (absent , dict ):
145- print (" " , absent [value ])
146+ print (f" { absent [value ]} " )
146147 else :
147148 absent = list (absent )
148149 for value in absent [:limit ]:
149- print ("-" , value )
150+ print (f"- { value } " )
150151 if isinstance (absent , dict ):
151- print (" " , absent [value ])
152- print ("- (plus %i more... truncated.)" % ( len ( absent ) - limit ) )
152+ print (f" { absent [value ]} " )
153+ print (f "- (plus { len ( absent ) - limit } more... truncated.)" )
153154
154155 if not fail :
155156 return 0
0 commit comments