aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-03-12 22:45:43 +0000
committerRob Austein <sra@hactrn.net>2013-03-12 22:45:43 +0000
commit54be63e6abf6e3a7c83a6c948ba05b7a0383ed39 (patch)
treea24e8d6480be53ceb91b4fbb297aff37b350f5d4
parent626ae389280aa498b3be6857445173e5fb4b2382 (diff)
Use inherit_token in from_POW_rfc3779(). See #460.
svn path=/trunk/; revision=5138
-rw-r--r--rpkid/rpki/resource_set.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/rpkid/rpki/resource_set.py b/rpkid/rpki/resource_set.py
index fcf8345a..39514ccb 100644
--- a/rpkid/rpki/resource_set.py
+++ b/rpkid/rpki/resource_set.py
@@ -687,11 +687,9 @@ class resource_bag(object):
temporary: in the long run, we should be using rpki.POW.IPAddress
rather than long here.
"""
- if any(x == 'inherit' for x in resources):
- raise rpki.exceptions.NotImplementedYet('The RFC3779 "inherit" element is not supported')
- asn = [resource_range_as(r[0], r[1]) for r in resources[0] or ()]
- v4 = [resource_range_ipv4(r[0], r[1]) for r in resources[1] or ()]
- v6 = [resource_range_ipv6(r[0], r[1]) for r in resources[2] or ()]
+ asn = inherit_token if resources[0] == "inherit" else [resource_range_as( r[0], r[1]) for r in resources[0] or ()]
+ v4 = inherit_token if resources[1] == "inherit" else [resource_range_ipv4(r[0], r[1]) for r in resources[1] or ()]
+ v6 = inherit_token if resources[2] == "inherit" else [resource_range_ipv6(r[0], r[1]) for r in resources[2] or ()]
return cls(resource_set_as(asn) if asn else None,
resource_set_ipv4(v4) if v4 else None,
resource_set_ipv6(v6) if v6 else None)