Skip to content

Commit

Permalink
organizations support: add exception handling for describe_organizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygould committed Sep 28, 2018
1 parent 4356e95 commit b8be517
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions moto/organizations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b8be517

Please sign in to comment.