|
@@ -190,12 +190,12 @@ class UpdateSession:
|
|
|
'''
|
|
|
try:
|
|
|
self._get_update_zone()
|
|
|
- self.__check_update_acl(self.__zname, self.__zclass)
|
|
|
self._create_diff()
|
|
|
prereq_result = self.__check_prerequisites()
|
|
|
if prereq_result != Rcode.NOERROR():
|
|
|
self.__make_response(prereq_result)
|
|
|
return UPDATE_ERROR, self.__zname, self.__zclass
|
|
|
+ self.__check_update_acl(self.__zname, self.__zclass)
|
|
|
update_result = self.__do_update()
|
|
|
if update_result != Rcode.NOERROR():
|
|
|
self.__make_response(update_result)
|
|
@@ -326,9 +326,7 @@ class UpdateSession:
|
|
|
only return what the result code would be (and not read/copy
|
|
|
any actual data).
|
|
|
'''
|
|
|
- result, _, _ = self.__diff.find(rrset.get_name(), rrset.get_type(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ result, _, _ = self.__diff.find(rrset.get_name(), rrset.get_type())
|
|
|
return result == ZoneFinder.SUCCESS
|
|
|
|
|
|
def __prereq_rrset_exists_value(self, rrset):
|
|
@@ -338,9 +336,7 @@ class UpdateSession:
|
|
|
Returns True if the prerequisite is satisfied, False otherwise.
|
|
|
'''
|
|
|
result, found_rrset, _ = self.__diff.find(rrset.get_name(),
|
|
|
- rrset.get_type(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ rrset.get_type())
|
|
|
if result == ZoneFinder.SUCCESS and\
|
|
|
rrset.get_name() == found_rrset.get_name() and\
|
|
|
rrset.get_type() == found_rrset.get_type():
|
|
@@ -379,9 +375,7 @@ class UpdateSession:
|
|
|
to only return what the result code would be (and not read/copy
|
|
|
any actual data).
|
|
|
'''
|
|
|
- result, rrsets, flags = self.__diff.find_all(rrset.get_name(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ result, rrsets, flags = self.__diff.find_all(rrset.get_name())
|
|
|
if result == ZoneFinder.SUCCESS and\
|
|
|
(flags & ZoneFinder.RESULT_WILDCARD == 0):
|
|
|
return True
|
|
@@ -606,9 +600,7 @@ class UpdateSession:
|
|
|
if rrset.get_type() == RRType.SOA():
|
|
|
return
|
|
|
result, orig_rrset, _ = self.__diff.find(rrset.get_name(),
|
|
|
- rrset.get_type(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ rrset.get_type())
|
|
|
if result == ZoneFinder.CNAME:
|
|
|
|
|
|
|
|
@@ -640,9 +632,7 @@ class UpdateSession:
|
|
|
zone's apex, and the type is either SOA or NS, it
|
|
|
is ignored.'''
|
|
|
result, to_delete, _ = self.__diff.find(rrset.get_name(),
|
|
|
- rrset.get_type(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ rrset.get_type())
|
|
|
if result == ZoneFinder.SUCCESS:
|
|
|
if to_delete.get_name() == self.__zname and\
|
|
|
(to_delete.get_type() == RRType.SOA() or\
|
|
@@ -665,9 +655,7 @@ class UpdateSession:
|
|
|
|
|
|
|
|
|
result, orig_rrset, _ = self.__diff.find(rrset.get_name(),
|
|
|
- rrset.get_type(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ rrset.get_type())
|
|
|
|
|
|
|
|
|
|
|
@@ -697,9 +685,7 @@ class UpdateSession:
|
|
|
Special case: if the name is the zone's apex, SOA and
|
|
|
NS records are kept.
|
|
|
'''
|
|
|
- result, rrsets, flags = self.__diff.find_all(rrset.get_name(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ result, rrsets, flags = self.__diff.find_all(rrset.get_name())
|
|
|
if result == ZoneFinder.SUCCESS and\
|
|
|
(flags & ZoneFinder.RESULT_WILDCARD == 0):
|
|
|
for to_delete in rrsets:
|
|
@@ -749,9 +735,7 @@ class UpdateSession:
|
|
|
|
|
|
|
|
|
|
|
|
- result, old_soa, _ = self.__diff.find(self.__zname, RRType.SOA(),
|
|
|
- ZoneFinder.NO_WILDCARD |
|
|
|
- ZoneFinder.FIND_GLUE_OK)
|
|
|
+ result, old_soa, _ = self.__diff.find(self.__zname, RRType.SOA())
|
|
|
|
|
|
if self.__added_soa is not None:
|
|
|
new_soa = self.__added_soa
|