exception messages are not displayed

Bug #1777548 reported by Tetsuro Nakamura on 2018-06-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Low
Tetsuro Nakamura

Bug Description

When I use OpenStack created by devstack AIO configuration,
Blazar client doen't display exception messages.

Actual
======

```
$ blazar lease-create --reservation resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1,affinity=True --start-date "2020-07-24 20:00" --end-date "2020-08-09 21:00" lease-1
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1', u'affinity', u'True')
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20', u'amount', u'1')
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024', u'disk_gb', u'20')
Matches: (u'resource_type=virtual:instance,vcpus=1', u'memory_mb', u'1024')
Matches: (u'resource_type=virtual:instance', u'vcpus', u'1')
Matches: (None, u'resource_type', u'virtual:instance')
Internal Server Error (HTTP 500)
```

But with -vv option, We find that keystone client has the exception message that has been created in Blazar server

````
$ blazar lease-create --reservation resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1,affinity=True --start-date "2020-07-24 20:00" --end-date "2020-08-09 21:00" lease-1 -vv
-- snip --
DEBUG: keystoneauth.session REQ: curl -g -i -X POST http://127.0.0.1/reservation/v1/leases -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-blazarclient" -H "X-Auth-Token: {SHA1}77c655c8786038c03182370032f9415e6c2367de" -d '{"before_end_date": null, "end_date": "2020-08-09 21:00", "reservations": [{"disk_gb": 20, "vcpus": 1, "memory_mb": 1024, "amount": 1, "affinity": "True", "resource_properties": "", "resource_type": "virtual:instance"}], "start_date": "2020-07-24 20:00", "events": [], "name": "lease-1"}'
DEBUG: urllib3.connectionpool Resetting dropped connection: 127.0.0.1
DEBUG: urllib3.connectionpool http://127.0.0.1:80 "POST /reservation/v1/leases HTTP/1.1" 500 92
DEBUG: keystoneauth.session RESP: [500] Connection: close Content-Length: 92 Content-Type: application/json Date: Tue, 19 Jun 2018 01:41:28 GMT Server: Apache/2.4.18 (Ubuntu)
DEBUG: keystoneauth.session RESP BODY: {"error_name": 500, "error_message": "affinity = True is not supported.", "error_code": 500}
-- snip --
```

Expected
========

We should display the error_message explicitly somethin like:

```
$ blazar lease-create --reservation resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1,affinity=True --start-date "2020-07-24 20:00" --end-date "2020-08-09 21:00" lease-1
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1', u'affinity', u'True')
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20', u'amount', u'1')
Matches: (u'resource_type=virtual:instance,vcpus=1,memory_mb=1024', u'disk_gb', u'20')
Matches: (u'resource_type=virtual:instance,vcpus=1', u'memory_mb', u'1024')
Matches: (u'resource_type=virtual:instance', u'vcpus', u'1')
Matches: (None, u'resource_type', u'virtual:instance')
Error: affinity = True is not supported. (HTTP 500)
```

Changed in blazar:
assignee: nobody → Tetsuro Nakamura (tetsuro0907)
description: updated
Bertrand Souville (souville) wrote :

bug description to be revised as https://review.openstack.org/#/c/575271/ has been merged, e.g.

DEBUG: keystoneauth.session RESP BODY: {"error_name": 400, "error_message": "Malformed parameter affinity (only affinity = False is supported)", "error_code": 400}

Changed in blazar:
status: New → Confirmed
Masahito Muroi (muroi-masahito) wrote :

This report has been already resolved by https://review.openstack.org/#/c/575686/

Changed in blazar:
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
milestone: none → rocky-3
importance: Undecided → Low

This issue was fixed in the openstack/python-blazarclient 2.0.0 release.

Pierre Riteau (priteau) on 2018-09-10
Changed in blazar:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers