diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-04-06 23:32:50 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-04-07 00:54:43 +0200 |
commit | 9e4e7493bac24b35b40e3cd9846e3a057cc7c5af (patch) | |
tree | 54f72677cc58f509abc9c0300a76cccfc2971362 /uci.py | |
parent | Let get_uci_key() build section key too (diff) | |
download | ansible-uci-9e4e7493bac24b35b40e3cd9846e3a057cc7c5af.tar.xz |
Add switch noreturn to uci_set()
Diffstat (limited to 'uci.py')
-rw-r--r-- | uci.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -76,13 +76,14 @@ def uci_get(module, binary, key): return None -def uci_set(module, binary, key, value): +def uci_set(module, binary, key, value, noreturn=False): status, stdout, stderr = module.run_command("{} set {}='{}'".format(binary, key, value)) if status != 0: module.fail_json(msg="Command uci failed with: {}".format(stderr)) - uci_commit(module, binary, split_key(key)[0]) - module.exit_json(changed=True) + if not noreturn: + uci_commit(module, binary, split_key(key)[0]) + module.exit_json(changed=True) def main(): |