Skip to content

Commit

Permalink
Bugfix/281-handle-none-roles (#286)
Browse files Browse the repository at this point in the history
* Bump to valid python version

* Minor tweak to roles logic and add a few doc notes
  • Loading branch information
rhysmeister authored Oct 9, 2024
1 parent 5fdced9 commit e029d38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/modules/cassandra_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
roles:
description:
- One or more roles to grant to this user or role.
- When set to None, the default, no action is perform on roles.
- Set to an empty list to revoke all roles.
type: list
elements: str
debug:
Expand Down Expand Up @@ -431,8 +433,8 @@ def build_role_grants(session,
current_roles.add(permission['role'])
else:
pass # We don't touch other perms here
# Revokes first
if current_roles is not None:
# Revokes first, roles should be an empty list to revoke all
if current_roles is not None and roles is not None:
for r in current_roles:
if r not in roles:
cql = revoke_role(session,
Expand Down

0 comments on commit e029d38

Please sign in to comment.