From fde27ae26e9c516608daf036c26e65a722851cd8 Mon Sep 17 00:00:00 2001 From: Remy Date: Mon, 4 Feb 2013 08:44:35 +0100 Subject: [PATCH] Added check so that upgrade cannot be used with other options. --- apt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apt b/apt index 39f5f8b99f2..97358615fdb 100644 --- a/apt +++ b/apt @@ -69,7 +69,7 @@ options: choices: [ "yes", "no" ] upgrade: description: - - If yes, performs an apt-get upgrade. If dist, performs an apt-get dist-upgrade. + - If yes, performs an apt-get upgrade. If dist, performs an apt-get dist-upgrade. Note: This does not upgrade a specific package, use state=latest for that. version_added: "1.1" required: false default: no @@ -230,6 +230,8 @@ def main(): if p['upgrade'] != 'no' and p['package'] is None: upgrade(module, p['upgrade']) + elif p['upgrade'] != 'no' and p['package'] != None: + module.fail_json(msg="Upgrade should not be used in conjunction with other options.") packages = p['package'].split(',') latest = p['state'] == 'latest'