From 07b7d77611d345a99a253c366529822e1cc0b1ff Mon Sep 17 00:00:00 2001 From: Brian Pandola Date: Fri, 13 May 2022 21:26:02 -0700 Subject: [PATCH] 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. --- moto/ram/models.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/moto/ram/models.py b/moto/ram/models.py index 061c91177..6f82c1c46 100644 --- a/moto/ram/models.py +++ b/moto/ram/models.py @@ -87,12 +87,13 @@ class ResourceShare(BaseModel): ) if root_id: - ous = ( - self.organizations_backend.list_organizational_units_for_parent( - ParentId=root_id - ) + ( + ous, + _, + ) = self.organizations_backend.list_organizational_units_for_parent( + parent_id=root_id ) - if any(principal == ou["Arn"] for ou in ous["OrganizationalUnits"]): + if any(principal == ou["Arn"] for ou in ous): continue raise UnknownResourceException(