Commit 9d42d008 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac648] Whitespace fixes

parent f1a6ba98
XXX. [func] shane
Add the ability to list the running BIND 10 processes using the
Add the ability to list the running BIND 10 processes using the
command channel. To try this, use "Boss show_processes".
(Trac #648, git yyy)
......
......@@ -275,7 +275,7 @@ class BoB:
pids.sort()
process_list = [ ]
for pid in pids:
process_list.append([ pid, self.processes[pid].name ])
process_list.append([pid, self.processes[pid].name])
return process_list
def command_handler(self, command, args):
......@@ -291,11 +291,11 @@ class BoB:
elif command == "ping":
answer = isc.config.ccsession.create_answer(0, "pong")
elif command == "show_processes":
answer = isc.config.ccsession.create_answer(0,
self.get_processes())
answer = isc.config.ccsession. \
create_answer(0, self.get_processes())
else:
print("should be doing the unknown command thingy")
answer = isc.config.ccsession.create_answer(1,
answer = isc.config.ccsession.create_answer(1,
"Unknown command")
return answer
......
......@@ -13,6 +13,6 @@ endif
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/bin/bind10 \
BIND10_MSGQ_SOCKET_FILE=$(abs_top_builddir)/msgq_socket \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
BIND10_MSGQ_SOCKET_FILE=$(abs_top_builddir)/msgq_socket \
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
done
......@@ -11,17 +11,17 @@ BIND10_EXE="../run_bind10.sh"
TIMEOUT=3
def _waitForString(bob, s):
"""Read the input from the Process object until we find the
"""Read the input from the Process object until we find the
string we're looking for or we timeout."""
found_string = False
start_time = time.time()
while time.time() < start_time + TIMEOUT:
(r,w,x) = select.select((bob.stdout,), (), (), TIMEOUT)
(r,w,x) = select.select((bob.stdout,), (), (), TIMEOUT)
if bob.stdout in r:
s = bob.stdout.readline()
if s == '':
break
if s.startswith(s):
if s.startswith(s):
found_string = True
break
return found_string
......@@ -93,7 +93,7 @@ class TestBossCmd(unittest.TestCase):
# connect to the command channel
self.cc = isc.cc.Session()
self.cc.group_subscribe('Boss')
# send a ping
cmd = { "command": ['show_processes']}
seq = self.cc.group_sendmsg(cmd, 'Boss')
......@@ -110,7 +110,7 @@ class TestBossCmd(unittest.TestCase):
if __name__ == '__main__':
# Python 3.2 and later support the setUpClass() and tearDownClass()
# Python 3.2 and later support the setUpClass() and tearDownClass()
# class methods to unittest, which are what we want to avoid having
# to start/stop BIND 10 every time we run the test. For versions of
# unittest that do not support this, we invoke them explicitly
......
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