fixed code to actually check the parameter not key
also made rest conditional on unit being provided, previouslly it changed from being always required fixes #23810 alternate to #23907pull/4420/head
parent
cb13aea88b
commit
72a4e1cf0d
|
@ -294,7 +294,7 @@ def main():
|
|||
}
|
||||
|
||||
for requires in ('state', 'enabled', 'masked'):
|
||||
if requires is not None and unit is None:
|
||||
if module.params[requires] is not None and unit is None:
|
||||
module.fail_json(msg="name is also required when specifying %s" % requires)
|
||||
|
||||
# Run daemon-reload first, if requested
|
||||
|
@ -303,6 +303,7 @@ def main():
|
|||
if rc != 0:
|
||||
module.fail_json(msg='failure %d during daemon-reload: %s' % (rc, err))
|
||||
|
||||
if unit:
|
||||
found = False
|
||||
is_initd = sysv_exists(unit)
|
||||
is_systemd = False
|
||||
|
|
Loading…
Reference in New Issue