From bdaebeb508a65f778b1230cc6f112f34745d6351 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Mon, 6 Apr 2020 11:16:22 +0000 Subject: Revert "Disallow setting default on internal network" The original patch assumes that both --external and --is-default are set in the same request and broke case when --is-default is set as an network update. The validation logic have to be moved on API side to avoid extra API calls from openstackclient. This reverts commit 962efd949feb461283a9bb4a668fbd310f80ba40. Related-Bug: #1745658 Change-Id: Idf08abb0e08a6880f89c3e9df9dd2ac82f36c432 --- openstackclient/network/v2/network.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 3f579b6d..00cb782b 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -16,7 +16,6 @@ from cliff import columns as cliff_columns from osc_lib.cli import format_columns from osc_lib.command import command -from osc_lib import exceptions from osc_lib import utils from osc_lib.utils import tags as _tag @@ -126,9 +125,6 @@ def _get_attrs_network(client_manager, parsed_args): attrs['is_default'] = False if parsed_args.default: attrs['is_default'] = True - if attrs.get('is_default') and not attrs.get('router:external'): - msg = _("Cannot set default for internal network") - raise exceptions.CommandError(msg) # Update Provider network options if parsed_args.provider_network_type: attrs['provider:network_type'] = parsed_args.provider_network_type @@ -706,8 +702,7 @@ class SetNetwork(command.Command): default_router_grp.add_argument( '--default', action='store_true', - help=_("Set the network as the default external network " - "(cannot be used with internal network).") + help=_("Set the network as the default external network") ) default_router_grp.add_argument( '--no-default', -- cgit v1.2.1