From 9e4e7493bac24b35b40e3cd9846e3a057cc7c5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Wed, 6 Apr 2016 23:32:50 +0200 Subject: Add switch noreturn to uci_set() --- uci.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/uci.py b/uci.py index 8574c45..79b1202 100644 --- a/uci.py +++ b/uci.py @@ -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(): -- cgit v1.2.3