Parcourir la source

[2911] cleanup: remove db_file arg from XfrinConnection ctor.

this class now doesn't rely on the low level interface anymore.
JINMEI Tatuya il y a 12 ans
Parent
commit
c612e8e22e
2 fichiers modifiés avec 3 ajouts et 8 suppressions
  1. 1 1
      src/bin/xfrin/tests/xfrin_test.py
  2. 2 7
      src/bin/xfrin/xfrin.py.in

+ 1 - 1
src/bin/xfrin/tests/xfrin_test.py

@@ -283,7 +283,7 @@ class MockXfrinConnection(XfrinConnection):
     def __init__(self, sock_map, zone_name, rrclass, datasrc_client,
                  shutdown_event, master_addr, tsig_key=None):
         super().__init__(sock_map, zone_name, rrclass, MockDataSourceClient(),
-                         shutdown_event, master_addr, TEST_DB_FILE)
+                         shutdown_event, master_addr)
         self.query_data = b''
         self.reply_data = b''
         self.force_time_out = False

+ 2 - 7
src/bin/xfrin/xfrin.py.in

@@ -565,13 +565,10 @@ class XfrinConnection(asyncore.dispatcher):
 
     def __init__(self,
                  sock_map, zone_name, rrclass, datasrc_client,
-                 shutdown_event, master_addrinfo, db_file, tsig_key=None,
+                 shutdown_event, master_addrinfo, tsig_key=None,
                  idle_timeout=60):
         '''Constructor of the XfirnConnection class.
 
-        db_file: SQLite3 DB file.  Unforutnately we still need this for
-                 temporary workaround in _get_zone_soa().  This should be
-                 removed when we eliminate the need for the workaround.
         idle_timeout: max idle time for read data from socket.
         datasrc_client: the data source client object used for the XFR session.
                         This will eventually replace db_file completely.
@@ -595,7 +592,6 @@ class XfrinConnection(asyncore.dispatcher):
         self._rrclass = rrclass
 
         # Data source handler
-        self._db_file = db_file
         self._datasrc_client = datasrc_client
         self._zone_soa = self._get_zone_soa()
 
@@ -1147,8 +1143,7 @@ def __process_xfrin(server, zone_name, rrclass, db_file,
         while retry:
             retry = False
             conn = conn_class(sock_map, zone_name, rrclass, datasrc_client,
-                              shutdown_event, master_addrinfo, db_file,
-                              tsig_key)
+                              shutdown_event, master_addrinfo, tsig_key)
             conn.init_socket()
             ret = XFRIN_FAIL
             if conn.connect_to_master():