summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorUkesh Kumar Vasudevan <ukeshkumar@gmail.com>2016-09-15 12:51:23 +0530
committerUkesh Kumar Vasudevan <ukeshkumar@gmail.com>2016-09-15 16:24:15 +0530
commite04e389da2e9d8ec96398356ceda2ab2388cdad5 (patch)
tree4330f86d0b92fe8f39248d7ba621516972683d28 /openstackclient/network
parentfb66a5b8f9a70ed3cb206febe0dae36779a19bf1 (diff)
downloadpython-openstackclient-e04e389da2e9d8ec96398356ceda2ab2388cdad5.tar.gz
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
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/router.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py
index f6d96d03..d30197cc 100644
--- a/openstackclient/network/v2/router.py
+++ b/openstackclient/network/v2/router.py
@@ -281,13 +281,20 @@ class ListRouter(command.Lister):
columns = columns + (
'routes',
'external_gateway_info',
- 'availability_zones'
)
column_headers = column_headers + (
'Routes',
'External gateway info',
- 'Availability zones'
)
+ # availability zone will be available only when
+ # router_availability_zone extension is enabled
+ if client.find_extension("router_availability_zone"):
+ columns = columns + (
+ 'availability_zones',
+ )
+ column_headers = column_headers + (
+ 'Availability zones',
+ )
data = client.routers()
return (column_headers,