From 53ba05325ad5e580e62addb7f4b405b96ad01d80 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Thu, 23 Mar 2017 15:24:38 +0100 Subject: Enable to create legacy router Some deployments create by default HA routers, this change enables to force the creation of a legacy router using: openstack router create --no-ha ... Closes-Bug: #1675514 Change-Id: I78f7dc3640a2acfdaf085e0e387b30373e8415f1 --- openstackclient/network/v2/router.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py index f46c8696..f322d5d1 100644 --- a/openstackclient/network/v2/router.py +++ b/openstackclient/network/v2/router.py @@ -183,11 +183,17 @@ class CreateRouter(command.ShowOne): default=False, help=_("Create a distributed router") ) - parser.add_argument( + ha_group = parser.add_mutually_exclusive_group() + ha_group.add_argument( '--ha', action='store_true', help=_("Create a highly available router") ) + ha_group.add_argument( + '--no-ha', + action='store_true', + help=_("Create a legacy router") + ) parser.add_argument( '--description', metavar='', @@ -216,7 +222,9 @@ class CreateRouter(command.ShowOne): attrs = _get_attrs(self.app.client_manager, parsed_args) if parsed_args.ha: - attrs['ha'] = parsed_args.ha + attrs['ha'] = True + if parsed_args.no_ha: + attrs['ha'] = False obj = client.create_router(**attrs) display_columns, columns = _get_columns(obj) -- cgit v1.2.1