Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
4db174c8
Commit
4db174c8
authored
Dec 06, 2011
by
Michal 'vorner' Vaner
Browse files
[1429] Use set_creator, not insert_creator
Just a naming convention
parent
3bb1cc7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/bind10/bind10_src.py.in
View file @
4db174c8
...
...
@@ -895,7 +895,7 @@ class BoB:
# rare, though.
pass
def
in
se
r
t_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
...
...
src/bin/bind10/tests/bind10_test.py.in
View file @
4db174c8
...
...
@@ -339,20 +339,20 @@ class TestBoB(unittest.TestCase):
self.assertEqual(bob.nocache, False)
self.assertIsNone(bob._socket_cache)
def test_
in
se
r
t_creator(self):
def test_set_creator(self):
"""
Test the call to
in
se
r
t_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.
in
se
r
t_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.
in
se
r
t_creator, creator)
self.assertRaises(ValueError, bob.set_creator, creator)
def test_init_alternate_socket(self):
bob = BoB("alt_socket_file")
...
...
src/lib/python/isc/bind10/special_component.py
View file @
4db174c8
...
...
@@ -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
.
in
se
r
t_creator
(
self
.
__creator
)
self
.
_boss
.
set_creator
(
self
.
__creator
)
self
.
_boss
.
log_started
(
self
.
pid
())
def
_stop_internal
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment