aboutsummaryrefslogtreecommitdiff
path: root/scripts/rpki/resource_set.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rpki/resource_set.py')
-rw-r--r--scripts/rpki/resource_set.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/rpki/resource_set.py b/scripts/rpki/resource_set.py
index b0de948b..705b0ac7 100644
--- a/scripts/rpki/resource_set.py
+++ b/scripts/rpki/resource_set.py
@@ -208,6 +208,17 @@ class resource_set(list):
assert isinstance(item, (type(i), type(i.min)))
return False
+ def issubset(self, other):
+ """Test whether self is a subset of other."""
+ for i in self:
+ if not other.contains(i):
+ return False
+ return True
+
+ def issuperset(self, other):
+ """Test whether self is a superset of other."""
+ return other.issubset(self)
+
@classmethod
def from_sql(cls, cursor, query):
"""Create resource set from an SQL query.