3 ^C @sLddlmZddlmZddlmZmZeddddgZGd d d eZd S) ) namedtuple)DiffResultDescriptor) Difference SymbolWrapperZmodified_common added_perms removed_perms matched_permsc@s8eZdZdZedZedZedZddZddZ dS)CommonDifferencezV Determine the difference in common permission sets between two policies. diff_commonscCs|jjdj||jdd|jjDdd|jjD\|_|_}t |_ xD|D]<\}}|j|j |j dd\}}}|s|rVt ||||j |<qVWdS)z8Generate the difference in commons between the policies.zFGenerating common differences from {0.left_policy} to {0.right_policy}css|]}t|VqdS)N)r).0cr/usr/lib64/python3.6/commons.py 0sz0CommonDifference.diff_commons..css|]}t|VqdS)N)r)r r rrrr1sF)ZunwrapN) loginfoformatZ _set_diffZ left_policyZcommonsZ right_policy added_commonsremoved_commonsdictmodified_commonsZpermsmodified_commons_record)selfZmatched_commonsZ left_commonZ right_commonrrr rrrr )s  zCommonDifference.diff_commonscCs"|jjdd|_d|_d|_dS)z%Reset diff results on policy changes.zResetting common differencesN)rdebugrrr)rrrr _reset_diffDs zCommonDifference._reset_diffN) __name__ __module__ __qualname____doc__rrrrr rrrrrr s r N) collectionsrZ descriptorsr differencerrrr rrrrs