Skip to content

Commit

Permalink
Fail if requested variable is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoya committed Oct 22, 2013
1 parent 4f13967 commit 3db7ec8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/database/mysql_variables
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3db7ec8

Please sign in to comment.