Fix Ram/Organizations interop

Pagination was added to Organizations:ListOrganizationalUnitsForParent, which
necessitated a change to the internal backend method call/response.

NOTE: We probably want to lift the pagination decorator up to the response
layer.  Calls between moto backends should not be concerned with pagination
at all, ideally; but this fix is the simplest solution for now.
This commit is contained in:
Brian Pandola 2022-05-13 21:26:02 -07:00 committed by Brian Pandola
parent eb3da8f91d
commit 07b7d77611

View File

@ -87,12 +87,13 @@ class ResourceShare(BaseModel):
) )
if root_id: if root_id:
ous = ( (
self.organizations_backend.list_organizational_units_for_parent( ous,
ParentId=root_id _,
) = self.organizations_backend.list_organizational_units_for_parent(
parent_id=root_id
) )
) if any(principal == ou["Arn"] for ou in ous):
if any(principal == ou["Arn"] for ou in ous["OrganizationalUnits"]):
continue continue
raise UnknownResourceException( raise UnknownResourceException(