From 3db7ec83562c3c7e29dfac4989a3034303e08474 Mon Sep 17 00:00:00 2001 From: Maykel Moya Date: Fri, 18 Oct 2013 13:11:47 +0200 Subject: [PATCH] Fail if requested variable is not available --- library/database/mysql_variables | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/database/mysql_variables b/library/database/mysql_variables index 42014c6d5a..4c0341f18e 100644 --- a/library/database/mysql_variables +++ b/library/database/mysql_variables @@ -201,6 +201,8 @@ def main(): if value is None: module.exit_json(msg=mysqlvar_val) else: + if len(mysqlvar_val) < 1: + module.fail_json(msg="Variable not available", changed=False) if value == mysqlvar_val[0][1]: module.exit_json(msg="Variable already set to requested value", changed=False) result = setvariable(cursor, mysqlvar, value)