Commit 4db174c8 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1429] Use set_creator, not insert_creator

Just a naming convention
parent 3bb1cc7d
......@@ -895,7 +895,7 @@ class BoB:
# rare, though.
pass
def insert_creator(self, creator):
def set_creator(self, creator):
"""
Registeres a socket creator into the boss. The socket creator is not
used directly, but through a cache. The cache is created in this
......
......@@ -339,20 +339,20 @@ class TestBoB(unittest.TestCase):
self.assertEqual(bob.nocache, False)
self.assertIsNone(bob._socket_cache)
def test_insert_creator(self):
def test_set_creator(self):
"""
Test the call to insert_creator. First time, the cache is created
Test the call to set_creator. First time, the cache is created
with the passed creator. The next time, it throws an exception.
"""
bob = BoB()
# The cache doesn't use it at start, so just create an empty class
class Creator: pass
creator = Creator()
bob.insert_creator(creator)
bob.set_creator(creator)
self.assertTrue(isinstance(bob._socket_cache,
isc.bind10.socket_cache.Cache))
self.assertEqual(creator, bob._socket_cache._creator)
self.assertRaises(ValueError, bob.insert_creator, creator)
self.assertRaises(ValueError, bob.set_creator, creator)
def test_init_alternate_socket(self):
bob = BoB("alt_socket_file")
......
......@@ -42,7 +42,7 @@ class SockCreator(BaseComponent):
self.__creator = isc.bind10.sockcreator.Creator(LIBEXECDIR + ':' +
os.environ['PATH'])
self._boss.register_process(self.pid(), self)
self._boss.insert_creator(self.__creator)
self._boss.set_creator(self.__creator)
self._boss.log_started(self.pid())
def _stop_internal(self):
......
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