Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tompal3 committed Feb 21, 2024
1 parent 273fd2c commit ea79c2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/module_utils/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def user_add(cursor, user, host, host_all, password, encrypted,
plugin, plugin_hash_string, plugin_auth_string, new_priv,
attributes, tls_requires, module, reuse_existing_password,
password_expire, password_expire_interval):
# If attributes are set, perform a sanity check to ensure server supports user attributes before creating user
if attributes and not get_attribute_support(cursor):
module.fail_json(msg="user attributes were specified but the server does not support user attributes")
# we cannot create users without a proper hostname
if host_all:
return {'changed': False, 'password_changed': False, 'attributes': attributes}
Expand Down Expand Up @@ -1086,6 +1089,9 @@ def get_attribute_support(cursor):
def attributes_get(cursor, user, host):
"""Get attributes for a given user.
Args:
cursor (cursor): DB driver cursor object.
user (str): User name.
host (str): User host name.
Returns:
Expand Down

0 comments on commit ea79c2a

Please sign in to comment.