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

[trac648] Whitespace fixes

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