Commit f621147e authored by Jelte Jansen's avatar Jelte Jansen

[1455] make shallow copy of to-be-modified list

parent b9a9623a
...@@ -19,6 +19,7 @@ from isc.log import * ...@@ -19,6 +19,7 @@ from isc.log import *
from isc.ddns.logger import logger, ClientFormatter, ZoneFormatter,\ from isc.ddns.logger import logger, ClientFormatter, ZoneFormatter,\
RRsetFormatter RRsetFormatter
from isc.log_messages.libddns_messages import * from isc.log_messages.libddns_messages import *
import copy
# Result codes for UpdateSession.handle() # Result codes for UpdateSession.handle()
UPDATE_SUCCESS = 0 UPDATE_SUCCESS = 0
...@@ -220,7 +221,10 @@ class UpdateSession: ...@@ -220,7 +221,10 @@ class UpdateSession:
# We need to match all actual RRs, unfortunately there is no # We need to match all actual RRs, unfortunately there is no
# direct order-independent comparison for rrsets, so this # direct order-independent comparison for rrsets, so this
# a slightly inefficient way to handle that. # a slightly inefficient way to handle that.
found_rdata = found_rrset.get_rdata()
# shallow copy of the rdata list, so we are sure that this
# loop does not mess with actual data.
found_rdata = copy.copy(found_rrset.get_rdata())
for rdata in rrset.get_rdata(): for rdata in rrset.get_rdata():
if rdata in found_rdata: if rdata in found_rdata:
found_rdata.remove(rdata) found_rdata.remove(rdata)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment