--long option breaks in router list if availability_zone ext is not loaded

Bug #1622565 reported by Fernando Jalon
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Ukesh

Bug Description

when calling router list with --long OSC expects the availability_zone field in the response, even if this extension is not loaded:

http://pastebin.com/raw/2BDYaPXS

In /usr/lib/python2.7/site-packages/openstackclient/network/v2/router.py if --long is called it's trying to parse availability_zones field:

    def take_action(self, parsed_args):
        client = self.app.client_manager.network

        columns = (
            'id',
            'name',
            'status',
            'admin_state_up',
            'distributed',
            'ha',
            'tenant_id',
        )
        column_headers = (
            'ID',
            'Name',
            'Status',
            'State',
            'Distributed',
            'HA',
            'Project',
        )
        if parsed_args.long:
            columns = columns + (
                'routes',
                'external_gateway_info',
                'availability_zones'
            )
            column_headers = column_headers + (
                'Routes',
                'External gateway info',
                'Availability zones'
            )

        data = client.routers()
        return (column_headers,
                (utils.get_item_properties(
                    s, columns,
                    formatters=_formatters,
                ) for s in data))

python-openstackclient-2.2.0-1.el7.noarch
openstack-neutron-8.1.2-1.el7.noarch

Seen also with OSC 2.6.0

description: updated
Richard Theis (rtheis)
tags: added: network
Ukesh (ukeshkumar)
Changed in python-openstackclient:
assignee: nobody → Ukesh (ukeshkumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

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

Changed in python-openstackclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/370574
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=e04e389da2e9d8ec96398356ceda2ab2388cdad5
Submitter: Jenkins
Branch: master

commit e04e389da2e9d8ec96398356ceda2ab2388cdad5
Author: Ukesh Kumar Vasudevan <email address hidden>
Date: Thu Sep 15 12:51:23 2016 +0530

    router list if availability_zone ext not enabled

    when calling router list with --long OSC expects the availability_zone
    field in the response, even if this extension is not loaded:

    As per the document, http://developer.openstack.org/api-ref/networking/
    v2/?expanded=list-routers-detail, The availability zone(s) for the router
    is available when router_availability_zone extension is enabled.

    Added testcase to test router list without availability zone

    Change-Id: Ic9abb06140eb310b797ade8b0463a876d8bea1b8
    Closes-bug: #1622565

Changed in python-openstackclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 3.3.0

This issue was fixed in the openstack/python-openstackclient 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.