Session not logging failing requests

Bug #1451625 reported by Jamie Lennox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
Medium
Jamie Lennox

Bug Description

When a request fails with a 400 or other not resp.ok value the boolean value of that response becomes False. That means when we execute this check: https://github.com/openstack/python-keystoneclient/blob/39b7f963f595ba3517c7e5540981bce356ec0e1b/keystoneclient/session.py#L204 the value is false.

This means when logging a failed request the values aren't read and so we get an output like:

DEBUG: keystoneclient.session REQ: curl -g -i -X PUT http://192.168.1.63:8776/v1/9e8e832aaea745f6938040eb848d4ce1/os-quota-sets/demo -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}946259cf29a705670882a5896a83f5f247209075" -d '{"quota_set": {"gigabytes": null, "tenant_id": "demo", "snapshots": null, "volumes": null}}'
INFO: requests.packages.urllib3.connectionpool Starting new HTTP connection (1): 192.168.1.63
DEBUG: requests.packages.urllib3.connectionpool "PUT /v1/9e8e832aaea745f6938040eb848d4ce1/os-quota-sets/demo HTTP/1.1" 400 141
DEBUG: keystoneclient.session RESP:
DEBUG: keystoneclient.session Request returned failure status: 400

Where there is no output information in the RESP line.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/179984

Changed in python-keystoneclient:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Changed in python-keystoneclient:
milestone: none → 1.4.0
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/179984
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=c7ec27a448d20201471a8f953e3b58b9ded589aa
Submitter: Jenkins
Branch: master

commit c7ec27a448d20201471a8f953e3b58b9ded589aa
Author: Jamie Lennox <email address hidden>
Date: Tue May 5 10:59:40 2015 +1000

    Ensure that failing responses are logged

    The boolean value of a failed response is False and so the way we
    populate the log output does not work when the request failed.

    When logging check that a response is not None rather than simply
    checking it's boolean value.

    Change-Id: I07fb46f156fdf8267fd3d4dc7c587cd604838d73
    Closes-Bug: #1451625

Changed in python-keystoneclient:
status: In Progress → Fix Committed
Changed in python-keystoneclient:
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.