mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-18 21:17:08 +00:00
Add MLS level comparison.
This commit is contained in:
parent
8de369a517
commit
3f90e48677
@ -70,6 +70,18 @@ class MLSLevel(symbol.PolicySymbol):
|
||||
|
||||
"""An MLS level."""
|
||||
|
||||
def __eq__(self, other):
|
||||
if self.policy == other.policy:
|
||||
if (self.qpol_symbol.get_sens_name(self.policy) != other.qpol_symbol.get_sens_name(self.policy)):
|
||||
return False
|
||||
|
||||
selfcats = set(str(c) for c in self.categories())
|
||||
othercats = set(str(c) for c in other.categories())
|
||||
return (not selfcats ^ othercats)
|
||||
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
def __str__(self):
|
||||
lvl = str(self.qpol_symbol.get_sens_name(self.policy))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user