Signed-off-by: IWASE Yusuke <iwase.yusu...@gmail.com> --- ryu/cmd/rpc_cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ryu/cmd/rpc_cli.py b/ryu/cmd/rpc_cli.py index 2c1eb6b..25b92fa 100755 --- a/ryu/cmd/rpc_cli.py +++ b/ryu/cmd/rpc_cli.py @@ -31,6 +31,7 @@ from __future__ import print_function +import ast import cmd import signal import socket @@ -139,9 +140,9 @@ class Cmd(cmd.Cmd): try: peer = args[0] method = args[1] - params = eval(args[2]) - except: - print("argument error") + params = ast.literal_eval(args[2]) + except (IndexError, ValueError) as e: + print("argument error: %s" % e) return try: p = peers[peer] -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel