Browse files

raise ValueError if the argument to node.replace_rdataset() is not an…

… rdataset
  • Loading branch information...
1 parent 4072dc5 commit 84fd7372b00afa4c55d4b32ca1d6f0c5a35b77df @rthalley committed Apr 7, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 dns/node.py
View
2 dns/node.py
@@ -167,6 +167,8 @@ def replace_rdataset(self, replacement):
at the node, it stores I{replacement} itself.
"""
+ if not isinstance(replacement, dns.rdataset.Rdataset):
+ raise ValueError, 'replacement is not an rdataset'
self.delete_rdataset(replacement.rdclass, replacement.rdtype,
replacement.covers)
self.rdatasets.append(replacement)

0 comments on commit 84fd737

Please sign in to comment.