Mistral API returns error with code 500 when user creates 2 workbook with the one name

Bug #1263942 reported by Timur Nurlygayanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Nikolay Makhotkin

Bug Description

Steps To Reproduce:
1. Send request to create workbook 'test'.
2 .Send request to create workbook 'test' again.

Python Tests Example:
from mistralclient.api import client

c = client.Client(username='admin', api_key='swordfish',
                  project_name='admin', auth_url='http://172.18.124.203:5000/v2.0/',
                  mistral_url='http://localhost:8989/v1')

c.workbooks.create('test')
c.workbooks.create('test')

Observed Result:
Error message:

Traceback (most recent call last):

  File "/home/ubuntu/mistral/.tox/venv/local/lib/python2.7/site-packages/wsmeext/pecan.py", line 77, in callfunction
    result = f(self, *args, **kwargs)

  File "/home/ubuntu/mistral/mistral/api/controllers/v1/workbook.py", line 75, in post
    wb = workbooks.create_workbook(workbook.to_dict())

  File "/home/ubuntu/mistral/mistral/services/workbooks.py", line 21, in create_workbook
    workbook = db_api.workbook_create(values)

  File "/home/ubuntu/mistral/mistral/db/api.py", line 66, in workbook_create
    return IMPL.workbook_create(values)

  File "/home/ubuntu/mistral/mistral/db/sqlalchemy/api.py", line 63, in decorator
    res = func(*args, **kwargs)

  File "/home/ubuntu/mistral/mistral/db/sqlalchemy/api.py", line 108, in _within_session
    result = func(*args, **kw)

  File "/home/ubuntu/mistral/mistral/db/sqlalchemy/api.py", line 267, in workbook_create
    raise Exception

Exception

Tags: api
summary: - Mistral API returns erorr with code 500 when user creates 2 workbook
+ Mistral API returns error with code 500 when user creates 2 workbook
with the one name
Changed in mistral:
assignee: nobody → Renat Akhmerov (rakhmerov)
Changed in mistral:
status: New → In Progress
assignee: Renat Akhmerov (rakhmerov) → Nikolay Makhotkin (nmakhotkin)
Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/64107
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=2176d57d15ac6b2090a2c953005749f8432e1bc5
Submitter: Jenkins
Branch: master

commit 2176d57d15ac6b2090a2c953005749f8432e1bc5
Author: Nikolay Mahotkin <email address hidden>
Date: Thu Dec 26 13:13:53 2013 +0400

    Fix workbook POST duplicate exception

     * 400 status code response on duplicate error
     * new exceptions - Mistral, DBDuplicateEntry
     * import exception from openstack-common

    Fixes bug: #1263942

    Change-Id: Ia802db5c6b30be96cb0b8ce2cfc0f7fd04122302

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.