mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Service module crashes if args has no "=".
This commit is contained in:
parent
49c3ee9050
commit
30ce430363
1 changed files with 6 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue