Lines Matching refs:format
123 format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')
125 logging.basicConfig(level=logging.INFO, format='%(message)s')
127 logging.basicConfig(level=logging.WARNING, format='%(message)s')
135 print("Policy Properties ({0} Modified)".format(len(diff.modified_properties)))
139 print(" * {0} +{1} -{2}".format(name, added, removed))
145 print("Commons ({0} Added, {1} Removed, {2} Modified)".format(
148 print(" Added Commons: {0}".format(len(diff.added_commons)))
150 print(" + {0}".format(c))
152 print(" Removed Commons: {0}".format(len(diff.removed_commons)))
154 print(" - {0}".format(c))
156 print(" Modified Commons: {0}".format(len(diff.modified_commons)))
160 change.append("{0} Added permissions".format(len(mod.added_perms)))
162 change.append("{0} Removed permissions".format(len(mod.removed_perms)))
164 print(" * {0} ({1})".format(name, ", ".join(change)))
166 print(" + {0}".format(p))
168 print(" - {0}".format(p))
173 print("Classes ({0} Added, {1} Removed, {2} Modified)".format(
176 print(" Added Classes: {0}".format(len(diff.added_classes)))
178 print(" + {0}".format(c))
180 print(" Removed Classes: {0}".format(len(diff.removed_classes)))
182 print(" - {0}".format(c))
184 print(" Modified Classes: {0}".format(len(diff.modified_classes)))
188 change.append("{0} Added permissions".format(len(mod.added_perms)))
190 change.append("{0} Removed permissions".format(len(mod.removed_perms)))
192 print(" * {0} ({1})".format(name, ", ".join(change)))
194 print(" + {0}".format(p))
196 print(" - {0}".format(p))
202 print("Booleans ({0} Added, {1} Removed, {2} Modified)".format(
206 print(" Added Booleans: {0}".format(len(diff.added_booleans)))
208 print(" + {0}".format(a))
210 print(" Removed Booleans: {0}".format(len(diff.removed_booleans)))
212 print(" - {0}".format(a))
214 print(" Modified Booleans: {0}".format(len(diff.modified_booleans)))
216 print(" * {0} (Modified default state)".format(name))
217 print(" + {0}".format(mod.added_state))
218 print(" - {0}".format(mod.removed_state))
224 print("Roles ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_roles),
228 print(" Added Roles: {0}".format(len(diff.added_roles)))
230 print(" + {0}".format(r))
232 print(" Removed Roles: {0}".format(len(diff.removed_roles)))
234 print(" - {0}".format(r))
236 print(" Modified Roles: {0}".format(len(diff.modified_roles)))
240 change.append("{0} Added types".format(len(mod.added_types)))
242 change.append("{0} Removed types".format(len(mod.removed_types)))
244 print(" * {0} ({1})".format(name, ", ".join(change)))
246 print(" + {0}".format(t))
248 print(" - {0}".format(t))
253 print("Types ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_types),
257 print(" Added Types: {0}".format(len(diff.added_types)))
259 print(" + {0}".format(r))
261 print(" Removed Types: {0}".format(len(diff.removed_types)))
263 print(" - {0}".format(r))
265 print(" Modified Types: {0}".format(len(diff.modified_types)))
269 change.append("{0} Added attributes".format(len(mod.added_attributes)))
271 change.append("{0} Removed attributes".format(len(mod.removed_attributes)))
273 change.append("{0} Added aliases".format(len(mod.added_aliases)))
275 change.append("{0} Removed aliases".format(len(mod.removed_aliases)))
282 print(" * {0} ({1})".format(name, ", ".join(change)))
286 print(" + {0}".format(t))
288 print(" - {0}".format(t))
293 print(" + {0}".format(t))
295 print(" - {0}".format(t))
302 print("Type Attributes ({0} Added, {1} Removed, {2} Modified)".format(
306 print(" Added Type Attributes: {0}".format(len(diff.added_type_attributes)))
308 print(" + {0}".format(a))
310 print(" Removed Type Attributes: {0}".format(len(diff.removed_type_attributes)))
312 print(" - {0}".format(a))
314 print(" Modified Type Attributes: {0}".format(len(diff.modified_type_attributes)))
318 change.append("{0} Added types".format(len(mod.added_types)))
320 change.append("{0} Removed types".format(len(mod.removed_types)))
322 print(" * {0} ({1})".format(name, ", ".join(change)))
324 print(" + {0}".format(t))
326 print(" - {0}".format(t))
331 print("Users ({0} Added, {1} Removed, {2} Modified)".format(len(diff.added_users),
335 print(" Added Users: {0}".format(len(diff.added_users)))
337 print(" + {0}".format(u))
339 print(" Removed Users: {0}".format(len(diff.removed_users)))
341 print(" - {0}".format(u))
343 print(" Modified Users: {0}".format(len(diff.modified_users)))
347 change.append("{0} Added roles".format(len(mod.added_roles)))
349 change.append("{0} Removed roles".format(len(mod.removed_roles)))
355 print(" * {0} ({1})".format(name, ", ".join(change)))
359 print(" + {0}".format(t))
361 print(" - {0}".format(t))
365 print(" + {0}".format(mod.added_level))
366 print(" - {0}".format(mod.removed_level))
370 print(" + {0}".format(mod.added_range))
371 print(" - {0}".format(mod.removed_range))
377 print("Categories ({0} Added, {1} Removed, {2} Modified)".format(
381 print(" Added Categories: {0}".format(len(diff.added_categories)))
383 print(" + {0}".format(c))
385 print(" Removed Categories: {0}".format(len(diff.removed_categories)))
387 print(" - {0}".format(c))
389 print(" Modified Categories: {0}".format(len(diff.modified_categories)))
393 change.append("{0} Added Aliases".format(len(mod.added_aliases)))
395 change.append("{0} Removed Aliases".format(len(mod.removed_aliases)))
397 print(" * {0} ({1})".format(name, ", ".join(change)))
400 print(" + {0}".format(a))
402 print(" - {0}".format(a))
409 print("Sensitivities ({0} Added, {1} Removed, {2} Modified)".format(
413 print(" Added Sensitivites: {0}".format(len(diff.added_sensitivities)))
415 print(" + {0}".format(s))
417 print(" Removed Sensitivities: {0}".format(len(diff.removed_sensitivities)))
419 print(" - {0}".format(s))
421 print(" Modified Sensitivities: {0}".format(len(diff.modified_sensitivities)))
425 change.append("{0} Added Aliases".format(len(mod.added_aliases)))
427 change.append("{0} Removed Aliases".format(len(mod.removed_aliases)))
429 print(" * {0} ({1})".format(name, ", ".join(change)))
432 print(" + {0}".format(a))
434 print(" - {0}".format(a))
441 print("Levels ({0} Added, {1} Removed, {2} Modified)".format(
445 print(" Added Levels: {0}".format(len(diff.added_levels)))
447 print(" + {0}".format(l))
449 print(" Removed Levels: {0}".format(len(diff.removed_levels)))
451 print(" - {0}".format(l))
453 print(" Modified Levels: {0}".format(len(diff.modified_levels)))
458 change.append("{0} Added Categories".format(len(added_categories)))
460 change.append("{0} Removed Categories".format(len(removed_categories)))
462 print(" * {0} ({1})".format(level.sensitivity, ", ".join(change)))
464 print(" + {0}".format(c))
466 print(" - {0}".format(c))
471 print("Allow Rules ({0} Added, {1} Removed, {2} Modified)".format(
475 print(" Added Allow Rules: {0}".format(len(diff.added_allows)))
477 print(" + {0}".format(r))
480 print(" Removed Allow Rules: {0}".format(len(diff.removed_allows)))
482 print(" - {0}".format(r))
485 print(" Modified Allow Rules: {0}".format(len(diff.modified_allows)))
492 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} {{ {1} }};".format(
496 rule_string += " [ {0} ]".format(rule.conditional)
499 print(" * {0}".format(rule_string))
507 print("Allowxperm Rules ({0} Added, {1} Removed, {2} Modified)".format(
512 print(" Added Allowxperm Rules: {0}".format(len(diff.added_allowxperms)))
514 print(" + {0}".format(r))
517 print(" Removed Allowxperm Rules: {0}".format(len(diff.removed_allowxperms)))
519 print(" - {0}".format(r))
522 print(" Modified Allowxperm Rules: {0}".format(len(diff.modified_allowxperms)))
540 perms.append("+[{0}]".format(p))
542 perms.append("+{0}".format(p))
546 perms.append("-[{0}]".format(p))
548 perms.append("-{0}".format(p))
552 format(rule, perms)
555 "{{ {1} }};".format(rule, " ".join(perms)))
562 print("Neverallow Rules ({0} Added, {1} Removed, {2} Modified)".format(
567 print(" Added Neverallow Rules: {0}".format(len(diff.added_neverallows)))
569 print(" + {0}".format(r))
572 print(" Removed Neverallow Rules: {0}".format(len(diff.removed_neverallows)))
574 print(" - {0}".format(r))
577 print(" Modified Neverallow Rules: {0}".format(len(diff.modified_neverallows)))
584 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} {{ {1} }};".format(
588 rule_string += " [ {0} ]".format(rule.conditional)
591 print(" * {0}".format(rule_string))
599 print("Neverallowxperm Rules ({0} Added, {1} Removed, {2} Modified)".format(
604 print(" Added Neverallowxperm Rules: {0}".format(
607 print(" + {0}".format(r))
610 print(" Removed Neverallowxperm Rules: {0}".format(
613 print(" - {0}".format(r))
616 print(" Modified Neverallowxperm Rules: {0}".format(
635 perms.append("+[{0}]".format(p))
637 perms.append("+{0}".format(p))
641 perms.append("-[{0}]".format(p))
643 perms.append("-{0}".format(p))
647 format(rule, perms)
650 "{{ {1} }};".format(rule, " ".join(perms)))
657 print("Auditallow Rules ({0} Added, {1} Removed, {2} Modified)".format(
662 print(" Added Auditallow Rules: {0}".format(len(diff.added_auditallows)))
664 print(" + {0}".format(r))
667 print(" Removed Auditallow Rules: {0}".format(len(diff.removed_auditallows)))
669 print(" - {0}".format(r))
672 print(" Modified Auditallow Rules: {0}".format(len(diff.modified_auditallows)))
679 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} {{ {1} }};".format(
683 rule_string += " [ {0} ]".format(rule.conditional)
686 print(" * {0}".format(rule_string))
694 print("Auditallowxperm Rules ({0} Added, {1} Removed, {2} Modified)".format(
699 print(" Added Auditallowxperm Rules: {0}".format(
702 print(" + {0}".format(r))
705 print(" Removed Auditallowxperm Rules: {0}".format(
708 print(" - {0}".format(r))
711 print(" Modified Auditallowxperm Rules: {0}".format(
730 perms.append("+[{0}]".format(p))
732 perms.append("+{0}".format(p))
736 perms.append("-[{0}]".format(p))
738 perms.append("-{0}".format(p))
742 format(rule, perms)
745 "{{ {1} }};".format(rule, " ".join(perms)))
752 print("Dontaudit Rules ({0} Added, {1} Removed, {2} Modified)".format(
757 print(" Added Dontaudit Rules: {0}".format(len(diff.added_dontaudits)))
759 print(" + {0}".format(r))
762 print(" Removed Dontaudit Rules: {0}".format(len(diff.removed_dontaudits)))
764 print(" - {0}".format(r))
767 print(" Modified Dontaudit Rules: {0}".format(len(diff.modified_dontaudits)))
774 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} {{ {1} }};".format(
778 rule_string += " [ {0} ]".format(rule.conditional)
781 print(" * {0}".format(rule_string))
789 print("Dontauditxperm Rules ({0} Added, {1} Removed, {2} Modified)".format(
794 print(" Added Dontauditxperm Rules: {0}".format(
797 print(" + {0}".format(r))
800 print(" Removed Dontauditxperm Rules: {0}".format(
803 print(" - {0}".format(r))
806 print(" Modified Dontauditxperm Rules: {0}".format(
825 perms.append("+[{0}]".format(p))
827 perms.append("+{0}".format(p))
831 perms.append("-[{0}]".format(p))
833 perms.append("-{0}".format(p))
837 format(rule, perms)
840 "{{ {1} }};".format(rule, " ".join(perms)))
847 print("Type_transition Rules ({0} Added, {1} Removed, {2} Modified)".format(
852 print(" Added Type_transition Rules: {0}".format(
855 print(" + {0}".format(r))
858 print(" Removed Type_transition Rules: {0}".format(
861 print(" - {0}".format(r))
864 print(" Modified Type_transition Rules: {0}".format(
869 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} +{1} -{2}".format(
873 rule_string += " {0}".format(rule.filename)
880 rule_string += " [ {0} ]".format(rule.conditional)
884 print(" * {0}".format(rule_string))
891 print("Type_change Rules ({0} Added, {1} Removed, {2} Modified)".format(
896 print(" Added Type_change Rules: {0}".format(len(diff.added_type_changes)))
898 print(" + {0}".format(r))
901 print(" Removed Type_change Rules: {0}".format(len(diff.removed_type_changes)))
903 print(" - {0}".format(r))
906 print(" Modified Type_change Rules: {0}".format(len(diff.modified_type_changes)))
910 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} +{1} -{2}".format(
914 rule_string += " {0}".format(rule.filename)
921 rule_string += " [ {0} ]".format(rule.conditional)
925 print(" * {0}".format(rule_string))
932 print("Type_member Rules ({0} Added, {1} Removed, {2} Modified)".format(
937 print(" Added Type_member Rules: {0}".format(len(diff.added_type_members)))
939 print(" + {0}".format(r))
942 print(" Removed Type_member Rules: {0}".format(len(diff.removed_type_members)))
944 print(" - {0}".format(r))
947 print(" Modified Type_member Rules: {0}".format(len(diff.modified_type_members)))
951 rule_string = "{0.ruletype} {0.source} {0.target}:{0.tclass} +{1} -{2}".format(
955 rule_string += " {0}".format(rule.filename)
962 rule_string += " [ {0} ]".format(rule.conditional)
966 print(" * {0}".format(rule_string))
972 print("Role allow Rules ({0} Added, {1} Removed)".format(
976 print(" Added Role Allow Rules: {0}".format(
979 print(" + {0}".format(r))
982 print(" Removed Role Allow Rules: {0}".format(
985 print(" - {0}".format(r))
992 print("Role_transition Rules ({0} Added, {1} Removed, {2} Modified)".format(
997 print(" Added Role_transition Rules: {0}".format(
1000 print(" + {0}".format(r))
1003 print(" Removed Role_transition Rules: {0}".format(
1006 print(" - {0}".format(r))
1009 print(" Modified Role_transition Rules: {0}".format(
1015 "{0.ruletype} {0.source} {0.target}:{0.tclass} +{1} -{2}".format(
1018 print(" * {0}".format(rule_string))
1025 print("Range_transition Rules ({0} Added, {1} Removed, {2} Modified)".format(
1030 print(" Added Range_transition Rules: {0}".format(
1033 print(" + {0}".format(r))
1036 print(" Removed Range_transition Rules: {0}".format(
1039 print(" - {0}".format(r))
1042 print(" Modified Range_transition Rules: {0}".format(
1050 "{0.ruletype} {0.source} {0.target}:{0.tclass} +[{1}] -[{2}]".format(
1053 print(" * {0}".format(rule_string))
1059 print("Constraints ({0} Added, {1} Removed)".format(
1063 print(" Added Constraints: {0}".format(
1066 print(" + {0}".format(r))
1069 print(" Removed Constraints: {0}".format(
1072 print(" - {0}".format(r))
1078 print("MLS Constraints ({0} Added, {1} Removed)".format(
1082 print(" Added MLS Constraints: {0}".format(
1085 print(" + {0}".format(r))
1088 print(" Removed MLS Constraints: {0}".format(
1091 print(" - {0}".format(r))
1097 print("Validatetrans ({0} Added, {1} Removed)".format(
1101 print(" Added Validatetrans: {0}".format(
1104 print(" + {0}".format(r))
1107 print(" Removed Validatetrans: {0}".format(
1110 print(" - {0}".format(r))
1116 print("MLS Validatetrans ({0} Added, {1} Removed)".format(
1120 print(" Added MLS Validatetrans: {0}".format(
1123 print(" + {0}".format(r))
1126 print(" Removed MLS Validatetrans: {0}".format(
1129 print(" - {0}".format(r))
1136 print("Initial SIDs ({0} Added, {1} Removed, {2} Modified)".format(
1140 print(" Added Initial SIDs: {0}".format(len(diff.added_initialsids)))
1142 print(" + {0}".format(s.statement()))
1144 print(" Removed Initial SIDs: {0}".format(len(diff.removed_initialsids)))
1146 print(" - {0}".format(s.statement()))
1148 print(" Modified Initial SIDs: {0}".format(len(diff.modified_initialsids)))
1150 print(" * {0} +[{1.added_context}] -[{1.removed_context}];".format(
1158 print("Fs_use ({0} Added, {1} Removed, {2} Modified)".format(
1162 print(" Added Fs_use: {0}".format(len(diff.added_fs_uses)))
1164 print(" + {0}".format(s))
1166 print(" Removed Fs_use: {0}".format(len(diff.removed_fs_uses)))
1168 print(" - {0}".format(s))
1170 print(" Modified Fs_use: {0}".format(len(diff.modified_fs_uses)))
1172 print(" * {0.ruletype} {0.fs} +[{1}] -[{2}];".format(
1180 print("Genfscons ({0} Added, {1} Removed, {2} Modified)".format(
1184 print(" Added Genfscons: {0}".format(len(diff.added_genfscons)))
1186 print(" + {0}".format(s))
1188 print(" Removed Genfscons: {0}".format(len(diff.removed_genfscons)))
1190 print(" - {0}".format(s))
1192 print(" Modified Genfscons: {0}".format(len(diff.modified_genfscons)))
1194 print(" * genfscon {0.fs} {0.path} {0.filetype} +[{1}] -[{2}];".format(
1202 print("Netifcons ({0} Added, {1} Removed, {2} Modified)".format(
1206 print(" Added Netifcons: {0}".format(len(diff.added_netifcons)))
1208 print(" + {0}".format(n))
1210 print(" Removed Netifcons: {0}".format(len(diff.removed_netifcons)))
1212 print(" - {0}".format(n))
1214 print(" Modified Netifcons: {0}".format(len(diff.modified_netifcons)))
1226 print(" * {0.netif} ({1})".format(entry.rule, ", ".join(change)))
1230 print(" + {0}".format(entry.added_context))
1231 print(" - {0}".format(entry.removed_context))
1234 print(" + {0}".format(entry.added_packet))
1235 print(" - {0}".format(entry.removed_packet))
1242 print("Nodecons ({0} Added, {1} Removed, {2} Modified)".format(
1246 print(" Added Nodecons: {0}".format(len(diff.added_nodecons)))
1248 print(" + {0}".format(n))
1250 print(" Removed Nodecons: {0}".format(len(diff.removed_nodecons)))
1252 print(" - {0}".format(n))
1254 print(" Modified Nodecons: {0}".format(len(diff.modified_nodecons)))
1257 print(" * nodecon {0.address} {0.netmask} +[{1}] -[{2}];".format(
1265 print("Portcons ({0} Added, {1} Removed, {2} Modified)".format(
1269 print(" Added Portcons: {0}".format(len(diff.added_portcons)))
1271 print(" + {0}".format(n))
1273 print(" Removed Portcons: {0}".format(len(diff.removed_portcons)))
1275 print(" - {0}".format(n))
1277 print(" Modified Portcons: {0}".format(len(diff.modified_portcons)))
1282 print(" * portcon {0.protocol} {1} +[{2}] -[{3}];".format(
1285 print(" * portcon {0.protocol} {1}-{2} +[{3}] -[{4}];".format(
1292 print("Policy Capabilities ({0} Added, {1} Removed)".format(
1295 print(" Added Policy Capabilities: {0}".format(len(diff.added_polcaps)))
1297 print(" + {0}".format(n))
1299 print(" Removed Policy Capabilities: {0}".format(len(diff.removed_polcaps)))
1301 print(" - {0}".format(n))
1307 print("Defaults ({0} Added, {1} Removed, {2} Modified)".format(
1310 print(" Added Defaults: {0}".format(len(diff.added_defaults)))
1312 print(" + {0}".format(d))
1314 print(" Removed Defaults: {0}".format(len(diff.removed_defaults)))
1316 print(" - {0}".format(d))
1318 print(" Modified Defaults: {0}".format(len(diff.modified_defaults)))
1321 line = " * {0.ruletype} {0.tclass} ".format(default)
1323 line += "+{0} -{1}".format(added_default, removed_default)
1328 line += " +{0} -{1};".format(added_range, removed_range)
1331 line += " {0};".format(default.default_range)
1340 print("Typebounds ({0} Added, {1} Removed, {2} Modified)".format(
1344 print(" Added Typebounds: {0}".format(len(diff.added_typebounds)))
1346 print(" + {0}".format(d))
1348 print(" Removed Typebounds: {0}".format(len(diff.removed_typebounds)))
1350 print(" - {0}".format(d))
1352 print(" Modified Typebounds: {0}".format(len(diff.modified_typebounds)))
1355 print(" * {0.ruletype} +{1} -{2} {0.child};".format(