return 500 if diskpool not exists when add disks to vm

Bug #1747591 reported by Huang Rui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zVM Cloud Connector
Confirmed
Low
cao biao

Bug Description

Request body:
'[{u'disk_pool': u'ECKD:notexist', u'size': u'1g'}]' for guest 'RST95754'.

Error msg:
{u'rs': 402, u'overallRC': 4, u'modID': 1, u'rc': 5, u'output': u'', u'errmsg': u"SMUT error: SMUT request failed. RequestData: 'getHost diskpoolspace noexist', Results: '{'rs': 402, 'errno': 0, 'strError': '', 'overallRC': 4, 'rc': 5, 'response': ['(Error) ULTGHO0402E No information was found for the specified pool(s): noexist']}'"}

Should return 404 if specified disk pool not exists.

Huang Rui (bjhuangr)
Changed in python-zvm-sdk:
importance: Undecided → Low
Huang Rui (bjhuangr)
Changed in python-zvm-sdk:
milestone: none → future
jichenjc (jichenjc)
Changed in python-zvm-sdk:
status: New → Confirmed
Huang Rui (bjhuangr)
Changed in python-zvm-sdk:
assignee: nobody → cao biao (flytiger)
cao biao (flytiger)
description: updated
Revision history for this message
jichenjc (jichenjc) wrote :

we need add a functional test for it if possible ...

Revision history for this message
cao biao (flytiger) wrote :

In wsgi code, we have handler about this:

req.response.status = util.get_http_code_from_sdk_return(info,
        additional_handler=util.handle_not_found)

if diskpool not found 'handle_not_found' will found it and change the status code to 404.
(Pdb) req
<Request at 0x3fff5b1c080 GET http://9.60.29.127:8888/host/diskpool?poolname=ECKD:dsaf>
(Pdb) req.response
<Response at 0x3fff5b1c048 404 Not Found>

as we can see, http code has been changed.

The problem is we didn't change the content of req.response.text.

In restclient, we just use response.text as the return results.

I will think about it and try to get a solution.

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.