From 808cd1b4e9d040c655b65b83616e7dbc73274f73 Mon Sep 17 00:00:00 2001 From: jkleint Date: Thu, 26 Apr 2012 10:48:50 -0300 Subject: [PATCH] Service module crashes if args has no "=". --- service | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/service b/service index 1bbbefb4712..c1aaf132729 100755 --- a/service +++ b/service @@ -37,9 +37,12 @@ if not len(items): sys.exit(1) params = {} -for x in items: - (k, v) = x.split("=") - params[k] = v +for arg in items: + if "=" not in arg: + print json.dumps(dict(failed=True, msg='expected arguments of the form name=value')) + sys.exit(1) + (name, value) = arg.split("=") + params[name] = value name = params['name'] state = params.get('state','unknown')