summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhanghao2 <zhanghao2@cmss.chinamobile.com>2019-10-01 05:19:34 -0400
committerzhanghao2 <zhanghao2@cmss.chinamobile.com>2019-10-01 05:21:19 -0400
commitee08644c5f2424a40c70010dcf0fa2ad84809bfc (patch)
treec6b31230851dd0e627e014028ac73cbf83e2c692
parentf61cd94e11e30a3e5dcf646e0b0a91e80f7d027b (diff)
downloadpython-neutronclient-ee08644c5f2424a40c70010dcf0fa2ad84809bfc.tar.gz
Remove 'public' and 'private' parameters in fwaas_v2
The 'public' and 'private' parameters have been replaced with 'share' and 'no-share' parameters in the Pike version, they can be removed now. Change-Id: I57a2e228ec1cdb6ed259914abc38bdada036d369
-rw-r--r--neutronclient/osc/v2/fwaas/firewallgroup.py27
-rw-r--r--neutronclient/osc/v2/fwaas/firewallpolicy.py25
-rw-r--r--neutronclient/osc/v2/fwaas/firewallrule.py25
-rw-r--r--neutronclient/tests/unit/osc/v2/fwaas/common.py14
-rw-r--r--releasenotes/notes/remove-public-and-private-parameters-d683e7c30ecedc3b.yaml6
5 files changed, 15 insertions, 82 deletions
diff --git a/neutronclient/osc/v2/fwaas/firewallgroup.py b/neutronclient/osc/v2/fwaas/firewallgroup.py
index fe8ab11..4287132 100644
--- a/neutronclient/osc/v2/fwaas/firewallgroup.py
+++ b/neutronclient/osc/v2/fwaas/firewallgroup.py
@@ -77,19 +77,6 @@ def _get_common_parser(parser):
action='store_true',
help=_('Detach egress firewall policy from the firewall group'))
shared_group = parser.add_mutually_exclusive_group()
- shared_group.add_argument(
- '--public',
- action='store_true',
- help=_('Make the firewall group public, which allows it to be '
- 'used in all projects (as opposed to the default, '
- 'which is to restrict its use to the current project). '
- 'This option is deprecated and would be removed in R release.'))
- shared_group.add_argument(
- '--private',
- action='store_true',
- help=_('Restrict use of the firewall group to the '
- 'current project. This option is deprecated '
- 'and would be removed in R release.'))
shared_group.add_argument(
'--share',
@@ -147,9 +134,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
cmd_resource=const.CMD_FWP)['id']
elif parsed_args.no_egress_firewall_policy:
attrs['egress_firewall_policy_id'] = None
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = True
- if parsed_args.no_share or parsed_args.private:
+ if parsed_args.no_share:
attrs['shared'] = False
if parsed_args.enable:
attrs['admin_state_up'] = True
@@ -350,14 +337,6 @@ class UnsetFirewallGroup(command.Command):
help=_('Egress firewall policy (name or ID) to delete'))
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
- '--public',
- action='store_true',
- help=_('Make the firewall group public, which allows it to be '
- 'used in all projects (as opposed to the default, '
- 'which is to restrict its use to the current project). '
- 'This option is deprecated and would be removed in R'
- ' release.'))
- shared_group.add_argument(
'--share',
action='store_true',
help=_('Restrict use of the firewall group to the '
@@ -375,7 +354,7 @@ class UnsetFirewallGroup(command.Command):
attrs['ingress_firewall_policy_id'] = None
if parsed_args.egress_firewall_policy:
attrs['egress_firewall_policy_id'] = None
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = False
if parsed_args.enable:
attrs['admin_state_up'] = False
diff --git a/neutronclient/osc/v2/fwaas/firewallpolicy.py b/neutronclient/osc/v2/fwaas/firewallpolicy.py
index 2c3d567..bd3e60d 100644
--- a/neutronclient/osc/v2/fwaas/firewallpolicy.py
+++ b/neutronclient/osc/v2/fwaas/firewallpolicy.py
@@ -80,9 +80,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
attrs['name'] = str(parsed_args.name)
if parsed_args.description:
attrs['description'] = str(parsed_args.description)
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = True
- if parsed_args.no_share or parsed_args.private:
+ if parsed_args.no_share:
attrs['shared'] = False
return attrs
@@ -108,19 +108,6 @@ def _get_common_parser(parser):
'(by default, it is restricted to be used by the '
'current project).'))
shared_group.add_argument(
- '--public',
- action='store_true',
- help=_('Make the firewall policy public, which allows it to be '
- 'used in all projects (as opposed to the default, which '
- 'is to restrict its use to the current project.) This '
- 'option is deprecated and would be removed in R release.'))
- shared_group.add_argument(
- '--private',
- action='store_true',
- help=_(
- 'Restrict use of the firewall policy to the current project.'
- 'This option is deprecated and would be removed in R release.'))
- shared_group.add_argument(
'--no-share',
action='store_true',
help=_('Restrict use of the firewall policy to the '
@@ -403,12 +390,6 @@ class UnsetFirewallPolicy(command.Command):
action='store_true',
help=_('Restrict use of the firewall policy to the '
'current project'))
- parser.add_argument(
- '--public',
- action='store_true',
- help=_('Restrict use of the firewall policy to the '
- 'current project. This option is deprecated '
- 'and would be removed in R release.'))
return parser
def _get_attrs(self, client_manager, parsed_args):
@@ -428,7 +409,7 @@ class UnsetFirewallPolicy(command.Command):
attrs[const.FWRS] = []
if parsed_args.audited:
attrs['audited'] = False
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = False
return attrs
diff --git a/neutronclient/osc/v2/fwaas/firewallrule.py b/neutronclient/osc/v2/fwaas/firewallrule.py
index f72bede..720c4d2 100644
--- a/neutronclient/osc/v2/fwaas/firewallrule.py
+++ b/neutronclient/osc/v2/fwaas/firewallrule.py
@@ -118,19 +118,6 @@ def _get_common_parser(parser):
help=_('Detach destination port number or range'))
shared_group = parser.add_mutually_exclusive_group()
shared_group.add_argument(
- '--public',
- action='store_true',
- help=_('Make the firewall policy public, which allows it to be '
- 'used in all projects (as opposed to the default, '
- 'which is to restrict its use to the current project). '
- 'This option is deprecated and would be removed in R Release'))
- shared_group.add_argument(
- '--private',
- action='store_true',
- help=_(
- 'Restrict use of the firewall rule to the current project.'
- 'This option is deprecated and would be removed in R release.'))
- shared_group.add_argument(
'--share',
action='store_true',
help=_('Share the firewall rule to be used in all projects '
@@ -212,9 +199,9 @@ def _get_common_attrs(client_manager, parsed_args, is_create=True):
attrs['enabled'] = True
if parsed_args.disable_rule:
attrs['enabled'] = False
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = True
- if parsed_args.no_share or parsed_args.private:
+ if parsed_args.no_share:
attrs['shared'] = False
if parsed_args.source_firewall_group:
attrs['source_firewall_group_id'] = client.find_resource(
@@ -417,12 +404,6 @@ class UnsetFirewallRule(command.Command):
action='store_true',
help=_('Restrict use of the firewall rule to the current project'))
parser.add_argument(
- '--public',
- action='store_true',
- help=_('Restrict use of the firewall rule to the current project. '
- 'This option is deprecated and would be removed in '
- 'R Release.'))
- parser.add_argument(
'--enable-rule',
action='store_true',
help=_('Disable this rule'))
@@ -448,7 +429,7 @@ class UnsetFirewallRule(command.Command):
attrs['destination_ip_address'] = None
if parsed_args.destination_port:
attrs['destination_port'] = None
- if parsed_args.share or parsed_args.public:
+ if parsed_args.share:
attrs['shared'] = False
if parsed_args.enable_rule:
attrs['enabled'] = False
diff --git a/neutronclient/tests/unit/osc/v2/fwaas/common.py b/neutronclient/tests/unit/osc/v2/fwaas/common.py
index 8acd51c..8b497a9 100644
--- a/neutronclient/tests/unit/osc/v2/fwaas/common.py
+++ b/neutronclient/tests/unit/osc/v2/fwaas/common.py
@@ -120,20 +120,6 @@ class TestSetFWaaS(test_fakes.TestNeutronClientOSCV2):
target, {self.res: {'shared': True}})
self.assertIsNone(result)
- def test_set_public(self):
- target = self.resource['id']
- arglist = [target, '--public']
- verifylist = [
- (self.res, target),
- ('public', True),
- ]
- parsed_args = self.check_parser(self.cmd, arglist, verifylist)
- result = self.cmd.take_action(parsed_args)
-
- self.mocked.assert_called_once_with(
- target, {self.res: {'shared': True}})
- self.assertIsNone(result)
-
def test_set_duplicate_shared(self):
target = self.resource['id']
arglist = [target, '--share', '--share']
diff --git a/releasenotes/notes/remove-public-and-private-parameters-d683e7c30ecedc3b.yaml b/releasenotes/notes/remove-public-and-private-parameters-d683e7c30ecedc3b.yaml
new file mode 100644
index 0000000..d340c17
--- /dev/null
+++ b/releasenotes/notes/remove-public-and-private-parameters-d683e7c30ecedc3b.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+ - |
+ The deprecated options ``--public`` and ``--private`` were
+ dropped in FWaaS v2 related commands. Use ``--share`` and
+ ``--no-share`` instead.