Merge pull request #4631 from mmoya/mysql_variables-fix3

Fail if requested variable is not available
This commit is contained in:
jctanner 2013-10-24 10:37:37 -07:00
commit f61a4c1eb3

View file

@ -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)