Skip to content
GitLab
Projects
Groups
Snippets
/
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
7035e189
Commit
7035e189
authored
Jun 11, 2013
by
Michal 'vorner' Vaner
Browse files
[2922] Wrap some long lines
parent
c049cba6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/msgq/msgq.py.in
View file @
7035e189
...
...
@@ -66,7 +66,9 @@ if "B10_FROM_BUILD" in os.environ:
else:
PREFIX = "@prefix@"
DATAROOTDIR = "@datarootdir@"
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}",
DATAROOTDIR). \
replace("${prefix}", PREFIX)
SPECFILE_LOCATION = SPECFILE_PATH + "/msgq.spec"
class MsgQReceiveError(Exception): pass
...
...
@@ -354,7 +356,8 @@ class MsgQ:
def register_socket(self, newsocket):
"""
Internal function to insert a socket. Used by process_accept and some tests.
Internal function to insert a socket. Used by process_accept and some
tests.
"""
self.sockets[newsocket.fileno()] = newsocket
lname = self.newlname()
...
...
@@ -610,7 +613,8 @@ class MsgQ:
This is done by using an increasing counter and the current
time."""
self.connection_counter += 1
return "%x_%x@%s" % (time.time(), self.connection_counter, self.hostname)
return "%x_%x@%s" % (time.time(), self.connection_counter,
self.hostname)
def process_command_ping(self, sock, routing, data):
self.sendmsg(sock, { CC_HEADER_TYPE : CC_COMMAND_PONG }, data)
...
...
@@ -885,7 +889,8 @@ if __name__ == "__main__":
a valid port number. Used by OptionParser() on startup."""
intval = int(value)
if (intval < 0) or (intval > 65535):
raise OptionValueError("%s requires a port number (0-65535)" % opt_str)
raise OptionValueError("%s requires a port number (0-65535)" %
opt_str)
parser.values.msgq_port = intval
# Parse any command-line options.
...
...
src/bin/msgq/tests/msgq_test.py
View file @
7035e189
...
...
@@ -64,7 +64,8 @@ class TestSubscriptionManager(unittest.TestCase):
for
s
in
socks
:
self
.
sm
.
subscribe
(
"a"
,
"*"
,
s
)
self
.
sm
.
unsubscribe
(
"a"
,
"*"
,
's3'
)
self
.
assertEqual
(
self
.
sm
.
find_sub
(
"a"
,
"*"
),
[
's1'
,
's2'
,
's4'
,
's5'
])
self
.
assertEqual
(
self
.
sm
.
find_sub
(
"a"
,
"*"
),
[
's1'
,
's2'
,
's4'
,
's5'
])
def
test_unsubscribe_all
(
self
):
self
.
sm
.
subscribe
(
'g1'
,
'i1'
,
's1'
)
...
...
@@ -799,9 +800,11 @@ class SendNonblock(unittest.TestCase):
send_exception is raised by BadSocket.
"""
(
write
,
read
)
=
socket
.
socketpair
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
(
control_write
,
control_read
)
=
socket
.
socketpair
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
(
control_write
,
control_read
)
=
socket
.
socketpair
(
socket
.
AF_UNIX
,
socket
.
SOCK_STREAM
)
badwrite
=
BadSocket
(
write
,
raise_on_send
,
send_exception
)
self
.
do_send
(
badwrite
,
read
,
control_write
,
control_read
,
expect_answer
,
expect_send_exception
)
self
.
do_send
(
badwrite
,
read
,
control_write
,
control_read
,
expect_answer
,
expect_send_exception
)
write
.
close
()
read
.
close
()
control_write
.
close
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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