diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-04-07 00:29:54 +0200 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-04-07 00:54:58 +0200 |
commit | e653a9f3200c82f3eba1f2ddfa3e02a3ab095a63 (patch) | |
tree | 86f094187afceb8e67886dbd27b09d6783c5487a | |
parent | Add more logic into get_uci_key() (diff) | |
download | ansible-uci-e653a9f3200c82f3eba1f2ddfa3e02a3ab095a63.tar.xz |
Add more logic into uci_set()
It handles empty value.
-rw-r--r-- | uci.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -83,6 +83,9 @@ def uci_get(module, binary, key): def uci_set(module, binary, key, value, noreturn=False): + if not value: + module.fail_json(msg="Value wasn't provided") + status, stdout, stderr = module.run_command("{} set {}='{}'".format(binary, key, value)) if status != 0: module.fail_json(msg="Command uci failed with: {}".format(stderr)) |