From e8cae1b73c2a6326706deac153ae6b110e8da80a Mon Sep 17 00:00:00 2001 From: Ashley Gould Date: Thu, 26 Jul 2018 12:20:43 -0700 Subject: [PATCH] organizations support: add exception handling for describe_organizations --- moto/organizations/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/moto/organizations/models.py b/moto/organizations/models.py index c02b1a492b5d..9d5fe388606e 100644 --- a/moto/organizations/models.py +++ b/moto/organizations/models.py @@ -157,6 +157,11 @@ def create_organization(self, **kwargs): return self.org.describe() def describe_organization(self): + if not self.org: + raise RESTError( + 'AWSOrganizationsNotInUseException', + "Your account is not a member of an organization." + ) return self.org.describe() def list_roots(self):