diff --git a/nova/api/openstack/placement/util.py b/nova/api/openstack/placement/util.py index e7185a0a86ad..f20eeef19cf4 100644 --- a/nova/api/openstack/placement/util.py +++ b/nova/api/openstack/placement/util.py @@ -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: diff --git a/nova/tests/functional/api/openstack/placement/gabbits/allocations-1.28.yaml b/nova/tests/functional/api/openstack/placement/gabbits/allocations-1.28.yaml index 839ef270835d..c1e356c7da83 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/allocations-1.28.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/allocations-1.28.yaml @@ -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: