From e416b55b1a472685e8c83ab378831ade70b1e171 Mon Sep 17 00:00:00 2001 From: sean-m-sullivan Date: Mon, 19 Oct 2020 15:15:33 -0500 Subject: [PATCH] update to fix missing options and fix pep8 --- awx_collection/plugins/modules/tower_role.py | 6 ++++-- awx_collection/test/awx/test_role.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/awx_collection/plugins/modules/tower_role.py b/awx_collection/plugins/modules/tower_role.py index 6ab8b0573d..f734fab852 100644 --- a/awx_collection/plugins/modules/tower_role.py +++ b/awx_collection/plugins/modules/tower_role.py @@ -147,9 +147,11 @@ def main(): argument_spec = dict( user=dict(), team=dict(), - role=dict(choices=["admin", "read", "member", "execute", "adhoc", "update", "use", "approval", "auditor", "project_admin", "inventory_admin", "credential_admin", + role=dict(choices=["admin", "read", "member", "execute", "adhoc", "update", "use", "approval", + "auditor", "project_admin", "inventory_admin", "credential_admin", "workflow_admin", "notification_admin", "job_template_admin"], required=True), target_team=dict(), + target_teams=dict(type='list', elements='str'), inventory=dict(), inventories=dict(type='list', elements='str'), job_template=dict(), @@ -159,6 +161,7 @@ def main(): credential=dict(), credentials=dict(type='list', elements='str'), organization=dict(), + organizations=dict(type='list', elements='str'), lookup_organization=dict(), project=dict(), projects=dict(type='list', elements='str'), @@ -178,7 +181,6 @@ def main(): 'credentials': 'credential', 'inventories': 'inventory', 'job_templates': 'job_template', - 'target_teams': 'target_team', 'organizations': 'organization', 'projects': 'project', 'target_teams': 'target_team', diff --git a/awx_collection/test/awx/test_role.py b/awx_collection/test/awx/test_role.py index 984825e27f..fcf8bf5900 100644 --- a/awx_collection/test/awx/test_role.py +++ b/awx_collection/test/awx/test_role.py @@ -48,6 +48,7 @@ def test_grant_workflow_permission(run_module, admin_user, organization, state): else: assert rando not in wfjt.execute_role + @pytest.mark.django_db @pytest.mark.parametrize('state', ('present', 'absent')) def test_grant_workflow_list_permission(run_module, admin_user, organization, state): @@ -70,6 +71,7 @@ def test_grant_workflow_list_permission(run_module, admin_user, organization, st else: assert rando not in wfjt.execute_role + @pytest.mark.django_db @pytest.mark.parametrize('state', ('present', 'absent')) def test_grant_workflow_approval_permission(run_module, admin_user, organization, state): @@ -91,6 +93,7 @@ def test_grant_workflow_approval_permission(run_module, admin_user, organization else: assert rando not in wfjt.approval_role + @pytest.mark.django_db def test_invalid_role(run_module, admin_user, project): rando = User.objects.create(username='rando')