Merge "Confusing log messages in project hierarchy checking"

This commit is contained in:
Jenkins 2017-09-05 01:58:54 +00:00 committed by Gerrit Code Review
commit fe87d28422
1 changed files with 7 additions and 8 deletions

View File

@ -119,19 +119,18 @@ class Manager(manager.Manager):
if parent_ref['is_domain']: if parent_ref['is_domain']:
if parent_ref['id'] != domain['id']: if parent_ref['id'] != domain['id']:
raise exception.ValidationError( raise exception.ValidationError(
message=_('Cannot create project, since its parent ' message=_('Cannot create project, the parent '
'(%(domain_id)s) is acting as a domain, ' '(%(parent_id)s) is acting as a domain, '
'but project\'s specified parent_id ' 'but this project\'s domain id (%(domain_id)s) '
'(%(parent_id)s) does not match ' 'does not match the parent\'s id.')
'this domain_id.') % {'parent_id': parent_ref['id'],
% {'domain_id': domain['id'], 'domain_id': domain['id']})
'parent_id': parent_ref['id']})
else: else:
parent_domain_id = parent_ref.get('domain_id') parent_domain_id = parent_ref.get('domain_id')
if parent_domain_id != domain['id']: if parent_domain_id != domain['id']:
raise exception.ValidationError( raise exception.ValidationError(
message=_('Cannot create project, since it specifies ' message=_('Cannot create project, since it specifies '
'its owner as domain %(domain_id)s, but ' 'its domain_id %(domain_id)s, but '
'specifies a parent in a different domain ' 'specifies a parent in a different domain '
'(%(parent_domain_id)s).') '(%(parent_domain_id)s).')
% {'domain_id': domain['id'], % {'domain_id': domain['id'],