mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Create system_administrator rbac role in migration
* We had race conditions with the system_administrator role being created just-in-time. Instead of fixing the race condition(s), dodge them by ensuring the role always exists
This commit is contained in:
committed by
Chris Meyers
parent
622f6ea166
commit
f51af03424
@@ -167,3 +167,9 @@ class TestMigrationSmoke:
|
||||
assert CredentialType.objects.filter(
|
||||
name=expected_name
|
||||
).exists(), f'Could not find {expected_name} credential type name, all names: {list(CredentialType.objects.values_list("name", flat=True))}'
|
||||
|
||||
# Verify the system_administrator role exists
|
||||
Role = new_state.apps.get_model('main', 'Role')
|
||||
assert Role.objects.filter(
|
||||
singleton_name='system_administrator', role_field='system_administrator'
|
||||
).exists(), "expected to find a system_administrator singleton role"
|
||||
|
||||
Reference in New Issue
Block a user