summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-17 15:18:20 +0000
committerGerrit Code Review <review@openstack.org>2017-04-17 15:18:20 +0000
commit62d71aa2435b2257670480dce73d2192652bb14d (patch)
treeeb4812cea53bf6f5c64333700d80c0635e814df2 /openstackclient/network
parentb168f2d998b70c16685a11b1e964aa9222ed363b (diff)
parentfe59e339ae6dd6a5e9075773fb5c2a0fea9c2e53 (diff)
downloadpython-openstackclient-62d71aa2435b2257670480dce73d2192652bb14d.tar.gz
Merge "Allow override of distributed router flag"
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/router.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/openstackclient/network/v2/router.py b/openstackclient/network/v2/router.py
index f322d5d1..0da91baa 100644
--- a/openstackclient/network/v2/router.py
+++ b/openstackclient/network/v2/router.py
@@ -78,8 +78,7 @@ def _get_attrs(client_manager, parsed_args):
attrs['admin_state_up'] = True
if parsed_args.disable:
attrs['admin_state_up'] = False
- # centralized is available only for SetRouter and not for CreateRouter
- if 'centralized' in parsed_args and parsed_args.centralized:
+ if parsed_args.centralized:
attrs['distributed'] = False
if parsed_args.distributed:
attrs['distributed'] = True
@@ -176,13 +175,17 @@ class CreateRouter(command.ShowOne):
action='store_true',
help=_("Disable router")
)
- parser.add_argument(
+ distribute_group = parser.add_mutually_exclusive_group()
+ distribute_group.add_argument(
'--distributed',
- dest='distributed',
action='store_true',
- default=False,
help=_("Create a distributed router")
)
+ distribute_group.add_argument(
+ '--centralized',
+ action='store_true',
+ help=_("Create a centralized router")
+ )
ha_group = parser.add_mutually_exclusive_group()
ha_group.add_argument(
'--ha',