Browse Source

Remove unused print and append the character '.' to the zone name which doesn't end with it.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac289@2612 e5f2f494-b856-4b98-b285-d166d9295462
Likun Zhang 14 years ago
parent
commit
c7769f6183

+ 2 - 4
src/lib/python/isc/notify/notify_out.py

@@ -133,13 +133,11 @@ class NotifyOut:
         return addr_list
 
     def send_notify(self, zone_name):
-        print('=============begin to send notify', zone_name, '===', self._notify_infos)
-        print(self._notify_infos)
+        if zone_name[len(zone_name) - 1] != '.':
+            zone_name += '.'
         if zone_name not in self._notify_infos:
-            print('=============not eixst')
             return
 
-        print('=============begin to send notify')
         with self._lock:
             if (self.notify_num >= _MAX_NOTIFY_NUM) or (zone_name in self._notifying_zones):
                 if zone_name not in self._waiting_zones:

+ 2 - 2
src/lib/python/isc/notify/tests/notify_out_test.py

@@ -58,11 +58,11 @@ class TestNotifyOut(unittest.TestCase):
         os.unlink(self._db_file.name)
 
     def test_send_notify(self):
-        self._notify.send_notify('cn.')
+        self._notify.send_notify('cn')
         self.assertEqual(self._notify.notify_num, 1)
         self.assertEqual(self._notify._notifying_zones[0], 'cn.')
 
-        self._notify.send_notify('com.')
+        self._notify.send_notify('com')
         self.assertEqual(self._notify.notify_num, 2)
         self.assertEqual(self._notify._notifying_zones[1], 'com.')