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 Jul 26, 2018
1 parent 28b0e14 commit e8cae1b
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 e8cae1b

Please sign in to comment.