Merge pull request #250 from jkleint/devel
Service module crashes if args has no "=".
This commit is contained in:
commit
13b8a57386
1 changed files with 6 additions and 3 deletions
9
service
9
service
|
@ -37,9 +37,12 @@ if not len(items):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
for x in items:
|
for arg in items:
|
||||||
(k, v) = x.split("=")
|
if "=" not in arg:
|
||||||
params[k] = v
|
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']
|
name = params['name']
|
||||||
state = params.get('state','unknown')
|
state = params.get('state','unknown')
|
||||||
|
|
Loading…
Reference in a new issue