From 821aa432a69344d32a1fbd2d36e41fce45b3e22d Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 20 Dec 2013 12:50:06 -0500 Subject: [PATCH] corrected indentation and now handles non existing previous key (not just changed existing) Signed-off-by: Brian Coca --- library/system/debconf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/system/debconf b/library/system/debconf index 1b48e04156f..23f147fcfa3 100644 --- a/library/system/debconf +++ b/library/system/debconf @@ -146,8 +146,12 @@ def main(): rc, msg, e = set_selection(module, pkg, question, type, value, unseen) if rc: module.fail_json(msg=e) - curr = { question: value } - prev = {question: prev[question]} + + curr = { question: value } + if question in prev: + prev = {question: prev[question]} + else: + prev[question] = '' module.exit_json(changed=changed, msg=msg, current=curr, previous=prev)