Browse Source

[1514] If the new serial number is greater or equal to the old one, the SOA in
zone should be replaced by the new one. If not, the serial number in SOA will be
increased automatically

haikuo zhang 13 years ago
parent
commit
0ed47de0a1
1 changed files with 3 additions and 7 deletions
  1. 3 7
      src/lib/python/isc/ddns/session.py

+ 3 - 7
src/lib/python/isc/ddns/session.py

@@ -729,16 +729,12 @@ class UpdateSession:
                                                 ZoneFinder.NO_WILDCARD |
                                                 ZoneFinder.FIND_GLUE_OK)
         serial_operation = DDNS_SOA()
-        if self.__added_soa is not None:
-            # serial check goes here
-            if serial_operation.soa_update_check(old_soa, self.__added_soa):
+        if self.__added_soa is not None and\
+        serial_operation.soa_update_check(old_soa, self.__added_soa):
                 new_soa = self.__added_soa
-            else:
-                pass
         else:
-            new_soa = old_soa
             # increment goes here
-            new_soa = serial_operation.update_soa(new_soa)
+            new_soa = serial_operation.update_soa(old_soa)
 
         diff.delete_data(old_soa)
         diff.add_data(new_soa)