Fail if requested variable is not available

reviewable/pr18780/r1
Maykel Moya 11 years ago
parent ce8b0944a9
commit 6155bf2c55

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

Loading…
Cancel
Save