Commit 5c03ce92 authored by Paul Selkirk's avatar Paul Selkirk
Browse files

[2967] refactoring: remove unneeded ZonemgrRefresh._zone_mgr_is_empty

parent 6d40ecfc
......@@ -275,11 +275,6 @@ class TestZonemgrRefresh(unittest.TestCase):
def test_send_command(self):
self.assertRaises(ZonemgrTestException, self.zone_refresh._send_command, "Unknown", "Notify", None)
def test_zone_mgr_is_empty(self):
self.assertFalse(self.zone_refresh._zone_mgr_is_empty())
self.zone_refresh._zonemgr_refresh_info = {}
self.assertTrue(self.zone_refresh._zone_mgr_is_empty())
def test_zonemgr_add_zone(self):
soa_rdata = 'a.example.net. root.example.net. 2009073106 1800 900 2419200 21600'
# This needs to be restored. The following test actually failed if we left
......
......@@ -378,13 +378,6 @@ class ZonemgrRefresh:
}
self._send_command(XFRIN_MODULE_NAME, ZONE_REFRESH_COMMAND, param)
def _zone_mgr_is_empty(self):
"""Does zone manager has no zone?"""
if not len(self._zonemgr_refresh_info):
return True
return False
def _run_timer(self, start_event):
while self._running:
# Notify run_timer that we already started and are inside the loop.
......@@ -394,14 +387,13 @@ class ZonemgrRefresh:
if start_event:
start_event.set()
start_event = None
# If zonemgr has no zone, set timer timeout to
# self._lowerbound_retry.
if self._zone_mgr_is_empty():
# If zonemgr has no zone, set timeout to minimum
if not len(self._zonemgr_refresh_info):
timeout = self._lowerbound_retry
else:
zone_need_refresh = self._find_need_do_refresh_zone()
# If don't get zone with minimum next refresh time, set timer
# timeout to self._lowerbound_retry.
# If don't get zone with minimum next refresh time, set
# timeout to minimum
if not zone_need_refresh:
timeout = self._lowerbound_retry
else:
......
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