mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-06 10:40:36 -07:00
It's a tuple and not a list 🤦
Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys <es.rosenberg+github@gmail.com>
This commit is contained in:
parent
3f7f036cb6
commit
f91d15e477
1 changed files with 2 additions and 3 deletions
|
@ -60,15 +60,14 @@ def user_is_locked(cursor, user, host):
|
||||||
|
|
||||||
# ACCOUNT LOCK does not have to be the last option in the CREATE USER query.
|
# ACCOUNT LOCK does not have to be the last option in the CREATE USER query.
|
||||||
# Need to handle both DictCursor and non-DictCursor
|
# Need to handle both DictCursor and non-DictCursor
|
||||||
if isinstance(result, list):
|
if isinstance(result, tuple):
|
||||||
if result[0].find('ACCOUNT LOCK') > 0:
|
if result[0].find('ACCOUNT LOCK') > 0:
|
||||||
return True
|
return True
|
||||||
elif isinstance(result, dict):
|
elif isinstance(result, dict):
|
||||||
for res in result.values():
|
for res in result.values():
|
||||||
if res.find('ACCOUNT LOCK') > 0:
|
if res.find('ACCOUNT LOCK') > 0:
|
||||||
return True
|
return True
|
||||||
from pprint import pprint
|
|
||||||
pprint(result)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue