aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-04-07 00:31:26 +0200
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-04-07 00:55:00 +0200
commit7c3a34407437e45039385a120df14603f36ab520 (patch)
treeb705f277eef15ac6f943f40ca6506c2ef462f0ce
parentAdd more logic into uci_set() (diff)
downloadansible-uci-7c3a34407437e45039385a120df14603f36ab520.tar.xz
Improve info gathering section
-rw-r--r--uci.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/uci.py b/uci.py
index 883c17f..ab9397a 100644
--- a/uci.py
+++ b/uci.py
@@ -134,7 +134,13 @@ def main():
## Get key and value - I need to make decisions
key, skey = get_uci_key(package, section, type, index, name)
- val = uci_get(module, bin_path, key)
+ if key:
+ val = uci_get(module, bin_path, key)
+ else:
+ val = None
+
+ if not val:
+ sval = uci_get(module, bin_path, skey)
## Handle deletes
if state == "absent":