mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-01 00:06:19 +00:00
sediff: Fix issue with policy properties heading with 0 changes.
The policy properties header would always be displayed if no specific difference was chosen.
This commit is contained in:
parent
f0bbab9547
commit
cf1342f4c8
16
sediff
16
sediff
@ -138,14 +138,14 @@ try:
|
||||
diff = setools.PolicyDifference(p1, p2)
|
||||
|
||||
if all_differences or args.property:
|
||||
print("Policy Properties ({0} Modified)".format(len(diff.modified_properties)))
|
||||
|
||||
if diff.modified_properties and not args.stats:
|
||||
for name, added, removed in sorted(diff.modified_properties, key=lambda x: x.property):
|
||||
print(" * {0} +{1} -{2}".format(name, added, removed))
|
||||
|
||||
print()
|
||||
del diff.modified_properties
|
||||
if diff.modified_properties or args.property:
|
||||
print("Policy Properties ({0} Modified)".format(len(diff.modified_properties)))
|
||||
if not args.stats:
|
||||
for name, added, removed in sorted(diff.modified_properties,
|
||||
key=lambda x: x.property):
|
||||
print(" * {0} +{1} -{2}".format(name, added, removed))
|
||||
print()
|
||||
del diff.modified_properties
|
||||
|
||||
if all_differences or args.common:
|
||||
if diff.added_commons or diff.removed_commons or diff.modified_commons or args.common:
|
||||
|
Loading…
Reference in New Issue
Block a user