Merge "placement: s/None/null/ in consumer conflict msg"

This commit is contained in:
Zuul 2018-06-29 07:23:21 +00:00 committed by Gerrit Code Review
commit 46ef5738ad
2 changed files with 16 additions and 1 deletions

View File

@ -640,7 +640,7 @@ def ensure_consumer(ctx, consumer_uuid, project_id, user_id,
if consumer_generation is not None:
raise webob.exc.HTTPConflict(
_('consumer generation conflict - '
'expected None but got %s') % consumer_generation)
'expected null but got %s') % consumer_generation)
# No such consumer. This is common for new allocations. Create the
# consumer record
try:

View File

@ -50,6 +50,21 @@ tests:
response_strings:
- JSON does not validate
- name: new version gen is not null no existing
PUT: /allocations/22222222-2222-2222-2222-222222222222
data:
allocations:
$ENVIRON['RP_UUID']:
resources:
DISK_GB: 10
project_id: $ENVIRON['PROJECT_ID']
user_id: $ENVIRON['USER_ID']
consumer_generation: 5
status: 409
response_strings:
- consumer generation conflict
- expected null but got 5
- name: new version gen is None no existing
PUT: /allocations/22222222-2222-2222-2222-222222222222
data: