Merge "Include project_id in the validation error on default project is domain"

This commit is contained in:
Jenkins 2016-05-21 00:44:15 +00:00 committed by Gerrit Code Review
commit 7dfebe3103
1 changed files with 4 additions and 2 deletions

View File

@ -834,8 +834,10 @@ class Manager(manager.Manager):
try:
project_ref = self.resource_api.get_project(default_project_id)
if project_ref['is_domain'] is True:
msg = _("User's default project ID cannot be a domain ID.")
raise exception.ValidationError(message=msg)
msg = _("User's default project ID cannot be a "
"domain ID: %s")
raise exception.ValidationError(
message=(msg % default_project_id))
except exception.ProjectNotFound:
# should be idempotent if project is not found so that it is
# backward compatible