Skip to content

Commit e7f707f

Browse files
n-ccn-cc
authored andcommitted
fix CI
1 parent 5273712 commit e7f707f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

plugins/module_utils/user.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ def user_add(cursor, user, host, host_all, password, encrypted,
155155
attributes, tls_requires, reuse_existing_password, module):
156156
# we cannot create users without a proper hostname
157157
if host_all:
158-
return {'changed': False, 'password_changed': False}
158+
return {'changed': False, 'password_changed': False, 'attributes': {}}
159159

160160
if module.check_mode:
161-
return {'changed': True, 'password_changed': None}
161+
return {'changed': True, 'password_changed': None, 'attributes': {}}
162162

163163
# If attributes are set, perform a sanity check to ensure server supports user attributes before creating user
164164
if attributes and not get_attribute_support(cursor):
@@ -417,6 +417,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
417417
privileges_revoke(cursor, user, host, db_table, revoke_privs, grant_option, maria_role)
418418
if len(grant_privs) > 0:
419419
privileges_grant(cursor, user, host, db_table, grant_privs, tls_requires, maria_role)
420+
changed = True
420421

421422
# after privilege manipulation, compare privileges from before and now
422423
after_priv = privileges_get(cursor, user, host, maria_role)
@@ -969,7 +970,7 @@ def get_attribute_support(cursor):
969970
# information_schema.tables does not hold the tables within information_schema itself
970971
cursor.execute("SELECT attribute FROM INFORMATION_SCHEMA.USER_ATTRIBUTES LIMIT 0")
971972
cursor.fetchone()
972-
except mysql_driver.OperationalError:
973+
except mysql_driver.Error:
973974
return False
974975

975976
return True

plugins/modules/mysql_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ def update(self, users, privs, check_mode=False,
931931
if privs:
932932
result = user_mod(self.cursor, self.name, self.host,
933933
None, None, None, None, None, None,
934-
privs, append_privs, subtract_privs, None,
934+
privs, append_privs, subtract_privs, None, None,
935935
self.module, role=True, maria_role=self.is_mariadb)
936936
changed = result['changed']
937937

plugins/modules/mysql_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
version_added: '3.8.0'
167167
attributes:
168168
description:
169-
- Create, update, or delete user attributes (arbitrary "key: value" comments) for the user.
169+
- "Create, update, or delete user attributes (arbitrary 'key: value' comments) for the user."
170170
- MySQL server must support the INFORMATION_SCHEMA.USER_ATTRIBUTES table. Provided since MySQL 8.0.
171171
- To delete an existing attribute, set its value to False.
172172
type: dict

0 commit comments

Comments
 (0)