diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-04-15 16:26:43 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-04-15 16:26:44 +0000 |
| commit | 881c8360303d80c390110bcd39348b64f0543b2c (patch) | |
| tree | 73f12e30cfa35f90ed1290ac6aa51960868341b4 /openstackclient/network | |
| parent | 52a12e743ea1047b6c34cd66dcb60cd61638ce1f (diff) | |
| parent | 67f8b898eb6d48b11b9f0624ac70f65c4311f8e8 (diff) | |
| download | python-openstackclient-881c8360303d80c390110bcd39348b64f0543b2c.tar.gz | |
Merge "Add external network options to osc network set"
Diffstat (limited to 'openstackclient/network')
| -rw-r--r-- | openstackclient/network/v2/network.py | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index 20d943ed..afac471a 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -76,6 +76,16 @@ def _get_attrs(client_manager, parsed_args): parsed_args.availability_zone_hints is not None: attrs['availability_zone_hints'] = parsed_args.availability_zone_hints + # update_external_network_options + if parsed_args.internal: + attrs['router:external'] = False + if parsed_args.external: + attrs['router:external'] = True + if parsed_args.no_default: + attrs['is_default'] = False + if parsed_args.default: + attrs['is_default'] = True + return attrs @@ -197,14 +207,6 @@ class CreateNetwork(common.NetworkAndComputeShowOne): def take_action_network(self, client, parsed_args): attrs = _get_attrs(self.app.client_manager, parsed_args) - if parsed_args.internal: - attrs['router:external'] = False - if parsed_args.external: - attrs['router:external'] = True - if parsed_args.no_default: - attrs['is_default'] = False - if parsed_args.default: - attrs['is_default'] = True if parsed_args.provider_network_type: attrs['provider:network_type'] = parsed_args.provider_network_type if parsed_args.physical_network: @@ -379,6 +381,26 @@ class SetNetwork(command.Command): action='store_true', help='Do not share the network between projects', ) + external_router_grp = parser.add_mutually_exclusive_group() + external_router_grp.add_argument( + '--external', + action='store_true', + help='Set this network as an external network. ' + 'Requires the "external-net" extension to be enabled.') + external_router_grp.add_argument( + '--internal', + action='store_true', + help='Set this network as an internal network') + default_router_grp = parser.add_mutually_exclusive_group() + default_router_grp.add_argument( + '--default', + action='store_true', + help='Specify if this network should be used as ' + 'the default external network') + default_router_grp.add_argument( + '--no-default', + action='store_true', + help='Do not use the network as the default external network.') return parser def take_action(self, parsed_args): |
