projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofp-util: Make put_stats__() public as ofputil_put_stats_header().
[openvswitch]
/
tests
/
appctl.py
diff --git
a/tests/appctl.py
b/tests/appctl.py
index bc694819d128e36935db9feed1a38582e3b76754..e5bcf2c03a397711d0e406783421f80fc3caf77f 100644
(file)
--- a/
tests/appctl.py
+++ b/
tests/appctl.py
@@
-1,4
+1,4
@@
-# Copyright (c) 2012 Nicira
Networks
.
+# Copyright (c) 2012 Nicira
, Inc
.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@
-13,10
+13,12
@@
# limitations under the License.
import argparse
# limitations under the License.
import argparse
+import signal
import sys
import ovs.daemon
import ovs.unixctl
import sys
import ovs.daemon
import ovs.unixctl
+import ovs.unixctl.client
import ovs.util
import ovs.vlog
import ovs.util
import ovs.vlog
@@
-28,7
+30,7
@@
def connect_to_target(target):
else:
socket_name = str_result
else:
socket_name = str_result
- error, client = ovs.unixctl.UnixctlClient.create(socket_name)
+ error, client = ovs.unixctl.
client.
UnixctlClient.create(socket_name)
if error:
ovs.util.ovs_fatal(error, "cannot connect to \"%s\"" % socket_name)
if error:
ovs.util.ovs_fatal(error, "cannot connect to \"%s\"" % socket_name)
@@
-45,8
+47,13
@@
def main():
help="Command to run.")
parser.add_argument("argv", metavar="ARG", nargs="*",
help="Arguments to the command.")
help="Command to run.")
parser.add_argument("argv", metavar="ARG", nargs="*",
help="Arguments to the command.")
+ parser.add_argument("-T", "--timeout", metavar="SECS",
+ help="wait at most SECS seconds for a response")
args = parser.parse_args()
args = parser.parse_args()
+ if args.timeout:
+ signal.alarm(int(args.timeout))
+
ovs.vlog.Vlog.init()
target = args.target
client = connect_to_target(target)
ovs.vlog.Vlog.init()
target = args.target
client = connect_to_target(target)