user get different interface to get request_ids

Bug #1542179 reported by Cao ShuFeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
Cao ShuFeng

Bug Description

This change expose x-openstack-request-id to users.
https://review.openstack.org/#/c/261399

However, for different action, user can't get a coherent interface to get x-openstack-request-id.

For example:
for a stop action:
         result = manager.stop(server)
         request_id = result[1].request_ids

for a delete action:
        result = manager.delete(server)
        request_id = result.request_ids

The difference will make user inconvenient.

We should provide user with coherent interface to get request_ids.

Cao ShuFeng (caosf-fnst)
Changed in python-novaclient:
assignee: nobody → Cao ShuFeng (caosf-fnst)
Cao ShuFeng (caosf-fnst)
description: updated
Changed in python-novaclient:
status: New → Invalid
status: Invalid → New
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
status: Invalid → In Progress
Changed in python-novaclient:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/276639
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=f535e6945b64509e2b9a1298fc502697691aa595
Submitter: Jenkins
Branch: master

commit f535e6945b64509e2b9a1298fc502697691aa595
Author: Cao Shufeng <email address hidden>
Date: Fri Feb 5 16:59:21 2016 +0800

    Provide user with coherent interface to get request_ids

    Currently, users must use different interface to get request_ids.
    1. Commonly, ListWithMeta, DictWithMeta or TupleWithMeta, etc is
    returned to user. And request_ids is returned as an attribute of
    *WithMeta.

        For a server delete action:
            result = serverManager.delete(server)
            # result = TupelWithMeta
            request_ids = result.request_ids

    2. Some places reutrn a tuple which contains request_ids in one of
    its elements.

        For a server stop action:
            result = serverManager.stop(server)
            # result = (Response, TupleWithMeta)
            request_ids = result[1].request_ids

    Such kind of difference makes user confused.
    This change provides a backwards compatibility solution for users
    who don't care about request_ids as TupleWithMeta is subclass of
    tuple.

    Change-Id: I164bb95abce6dc96cf455033f02822ccb0d87b8f
    Closes-Bug: 1542179

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-novaclient 3.3.0

This issue was fixed in the openstack/python-novaclient 3.3.0 release.

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.