Remove beta label for network segment resource

With Ocata development opened, neutron network segments are no
longer beta resources.

Change-Id: I25be51c30df17c746136471b88840f64a03187b9
Partially-Implements: blueprint routed-networks
This commit is contained in:
Richard Theis 2016-09-28 08:16:22 -05:00
parent 81a2b9a6bc
commit 256ec66f79
8 changed files with 23 additions and 164 deletions

View File

@ -14,10 +14,6 @@ network segment create
Create new network segment
.. caution:: This is a beta command and subject to change.
Use global option ``--os-beta-command`` to
enable this command.
.. program:: network segment create
.. code:: bash
@ -63,10 +59,6 @@ network segment delete
Delete network segment(s)
.. caution:: This is a beta command and subject to change.
Use global option ``--os-beta-command`` to
enable this command.
.. program:: network segment delete
.. code:: bash
@ -83,10 +75,6 @@ network segment list
List network segments
.. caution:: This is a beta command and subject to change.
Use global option ``--os-beta-command`` to
enable this command.
.. program:: network segment list
.. code:: bash
@ -107,10 +95,6 @@ network segment set
Set network segment properties
.. caution:: This is a beta command and subject to change.
Use global option ``--os-beta-command`` to
enable this command.
.. program:: network segment set
.. code:: bash
@ -137,10 +121,6 @@ network segment show
Display network segment details
.. caution:: This is a beta command and subject to change.
Use global option ``--os-beta-command`` to
enable this command.
.. program:: network segment show
.. code:: bash

View File

@ -116,11 +116,7 @@ Create new subnet
.. option:: --network-segment <network-segment>
Network segment to associate with this subnet (ID only)
.. caution:: This is a beta command option and subject
to change. Use global option ``--os-beta-command``
to enable this command option.
Network segment to associate with this subnet (name or ID)
.. option:: --service-type <service-type>

View File

@ -26,12 +26,7 @@ LOG = logging.getLogger(__name__)
class CreateNetworkSegment(command.ShowOne):
"""Create new network segment
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
"""Create new network segment"""
def get_parser(self, prog_name):
parser = super(CreateNetworkSegment, self).get_parser(prog_name)
@ -76,7 +71,6 @@ class CreateNetworkSegment(command.ShowOne):
return parser
def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network
attrs = {}
attrs['name'] = parsed_args.name
@ -96,12 +90,7 @@ class CreateNetworkSegment(command.ShowOne):
class DeleteNetworkSegment(command.Command):
"""Delete network segment(s)
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
"""Delete network segment(s)"""
def get_parser(self, prog_name):
parser = super(DeleteNetworkSegment, self).get_parser(prog_name)
@ -114,7 +103,6 @@ class DeleteNetworkSegment(command.Command):
return parser
def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network
result = 0
@ -137,12 +125,7 @@ class DeleteNetworkSegment(command.Command):
class ListNetworkSegment(command.Lister):
"""List network segments
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
"""List network segments"""
def get_parser(self, prog_name):
parser = super(ListNetworkSegment, self).get_parser(prog_name)
@ -161,8 +144,6 @@ class ListNetworkSegment(command.Lister):
return parser
def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
network_client = self.app.client_manager.network
filters = {}
@ -204,12 +185,7 @@ class ListNetworkSegment(command.Lister):
class SetNetworkSegment(command.Command):
"""Set network segment properties
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
"""Set network segment properties"""
def get_parser(self, prog_name):
parser = super(SetNetworkSegment, self).get_parser(prog_name)
@ -231,7 +207,6 @@ class SetNetworkSegment(command.Command):
return parser
def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network
obj = client.find_segment(parsed_args.network_segment,
ignore_missing=False)
@ -244,12 +219,7 @@ class SetNetworkSegment(command.Command):
class ShowNetworkSegment(command.ShowOne):
"""Display network segment details
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
"""Display network segment details"""
def get_parser(self, prog_name):
parser = super(ShowNetworkSegment, self).get_parser(prog_name)
@ -261,8 +231,6 @@ class ShowNetworkSegment(command.ShowOne):
return parser
def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network
obj = client.find_segment(
parsed_args.network_segment,

View File

@ -179,7 +179,7 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
attrs['ipv6_ra_mode'] = parsed_args.ipv6_ra_mode
if parsed_args.ipv6_address_mode is not None:
attrs['ipv6_address_mode'] = parsed_args.ipv6_address_mode
if 'network_segment' in parsed_args:
if parsed_args.network_segment is not None:
attrs['segment_id'] = client.find_segment(
parsed_args.network_segment, ignore_missing=False).id
@ -299,13 +299,12 @@ class CreateSubnet(command.ShowOne):
help=_("IPv6 address mode, "
"valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]")
)
if self.app.options.os_beta_command:
parser.add_argument(
'--network-segment',
metavar='<network-segment>',
help=_("Network segment to associate with this subnet "
"(ID only)")
)
parser.add_argument(
'--network-segment',
metavar='<network-segment>',
help=_("Network segment to associate with this subnet "
"(name or ID)")
)
parser.add_argument(
'--network',
required=True,

View File

@ -39,8 +39,7 @@ class NetworkSegmentTests(base.TestCase):
if cls.NETWORK_SEGMENT_EXTENSION:
# Get the segment for the network.
opts = cls.get_opts(['ID', 'Network'])
raw_output = cls.openstack('--os-beta-command '
'network segment list '
raw_output = cls.openstack('network segment list '
' --network ' + cls.NETWORK_NAME +
' ' + opts)
raw_output_row = raw_output.split('\n')[0]
@ -55,14 +54,12 @@ class NetworkSegmentTests(base.TestCase):
if self.NETWORK_SEGMENT_EXTENSION:
opts = self.get_opts(['id'])
raw_output = self.openstack(
'--os-beta-command' +
' network segment create --network ' + self.NETWORK_ID +
' --network-type geneve ' +
' --segment 2055 test_segment ' + opts
)
network_segment_id = raw_output.strip('\n')
raw_output = self.openstack('--os-beta-command ' +
'network segment delete ' +
raw_output = self.openstack('network segment delete ' +
network_segment_id)
self.assertOutput('', raw_output)
else:
@ -71,8 +68,7 @@ class NetworkSegmentTests(base.TestCase):
def test_network_segment_list(self):
if self.NETWORK_SEGMENT_EXTENSION:
opts = self.get_opts(['ID'])
raw_output = self.openstack('--os-beta-command '
'network segment list' + opts)
raw_output = self.openstack('network segment list' + opts)
self.assertIn(self.NETWORK_SEGMENT_ID, raw_output)
else:
self.skipTest('Segment extension disabled')
@ -80,14 +76,12 @@ class NetworkSegmentTests(base.TestCase):
def test_network_segment_set(self):
if self.NETWORK_SEGMENT_EXTENSION:
new_description = 'new_description'
raw_output = self.openstack('--os-beta-command '
'network segment set ' +
raw_output = self.openstack('network segment set ' +
'--description ' + new_description +
' ' + self.NETWORK_SEGMENT_ID)
self.assertOutput('', raw_output)
opts = self.get_opts(['description'])
raw_output = self.openstack('--os-beta-command '
'network segment show ' +
raw_output = self.openstack('network segment show ' +
self.NETWORK_SEGMENT_ID + opts)
self.assertEqual(new_description + "\n", raw_output)
else:
@ -96,8 +90,7 @@ class NetworkSegmentTests(base.TestCase):
def test_network_segment_show(self):
if self.NETWORK_SEGMENT_EXTENSION:
opts = self.get_opts(['network_id'])
raw_output = self.openstack('--os-beta-command '
'network segment show ' +
raw_output = self.openstack('network segment show ' +
self.NETWORK_SEGMENT_ID + opts)
self.assertEqual(self.NETWORK_ID + "\n", raw_output)
else:

View File

@ -26,9 +26,6 @@ class TestNetworkSegment(network_fakes.TestNetworkV2):
def setUp(self):
super(TestNetworkSegment, self).setUp()
# Enable beta commands.
self.app.options.os_beta_command = True
# Get a shortcut to the network client
self.network = self.app.client_manager.network
@ -81,22 +78,6 @@ class TestCreateNetworkSegment(TestNetworkSegment):
self.assertRaises(tests_utils.ParserException, self.check_parser,
self.cmd, [], [])
def test_create_no_beta_commands(self):
arglist = [
'--network', self._network_segment.network_id,
'--network-type', self._network_segment.network_type,
self._network_segment.name,
]
verifylist = [
('network', self._network_segment.network_id),
('network_type', self._network_segment.network_type),
('name', self._network_segment.name),
]
self.app.options.os_beta_command = False
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
parsed_args)
def test_create_invalid_network_type(self):
arglist = [
'--network', self._network_segment.network_id,
@ -192,18 +173,6 @@ class TestDeleteNetworkSegment(TestNetworkSegment):
self.namespace
)
def test_delete_no_beta_commands(self):
arglist = [
self._network_segments[0].id,
]
verifylist = [
('network_segment', [self._network_segments[0].id]),
]
self.app.options.os_beta_command = False
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
parsed_args)
def test_delete(self):
arglist = [
self._network_segments[0].id,
@ -330,12 +299,6 @@ class TestListNetworkSegment(TestNetworkSegment):
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, list(data))
def test_list_no_beta_commands(self):
self.app.options.os_beta_command = False
parsed_args = self.check_parser(self.cmd, [], [])
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
parsed_args)
def test_list_long(self):
arglist = [
'--long',
@ -391,18 +354,6 @@ class TestSetNetworkSegment(TestNetworkSegment):
# Get the command object to test
self.cmd = network_segment.SetNetworkSegment(self.app, self.namespace)
def test_set_no_beta_commands(self):
arglist = [
self._network_segment.id,
]
verifylist = [
('network_segment', self._network_segment.id),
]
self.app.options.os_beta_command = False
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
parsed_args)
def test_set_no_options(self):
arglist = [
self._network_segment.id,
@ -485,18 +436,6 @@ class TestShowNetworkSegment(TestNetworkSegment):
self.assertRaises(tests_utils.ParserException, self.check_parser,
self.cmd, [], [])
def test_show_no_beta_commands(self):
arglist = [
self._network_segment.id,
]
verifylist = [
('network_segment', self._network_segment.id),
]
self.app.options.os_beta_command = False
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.assertRaises(exceptions.CommandError, self.cmd.take_action,
parsed_args)
def test_show_all_options(self):
arglist = [
self._network_segment.id,

View File

@ -379,23 +379,6 @@ class TestCreateSubnet(TestSubnet):
self.assertEqual(self.columns, columns)
self.assertEqual(self.data_ipv6, data)
def test_create_no_beta_command_options(self):
arglist = [
"--subnet-range", self._subnet.cidr,
"--network-segment", self._network_segment.id,
"--network", self._subnet.network_id,
self._subnet.name,
]
verifylist = [
('name', self._subnet.name),
('subnet_range', self._subnet.cidr),
('network-segment', self._network_segment.id),
('network', self._subnet.network_id),
]
self.app.options.os_beta_command = False
self.assertRaises(tests_utils.ParserException,
self.check_parser, self.cmd, arglist, verifylist)
def test_create_with_network_segment(self):
# Mock SDK calls for this test.
self.network.create_subnet = mock.Mock(return_value=self._subnet)
@ -417,7 +400,6 @@ class TestCreateSubnet(TestSubnet):
]
self.app.options.os_beta_command = True
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)

View File

@ -1,6 +1,8 @@
---
features:
- Add ``network segment create``, ``network segment delete`` and
``network segment set`` commands. These are beta commands and subject to
change. Use global option ``--os-beta-command`` to enable these commands.
``network segment set`` commands. In addition, the ``network segment list``
and ``network segment show`` commands are no longer beta commands and
the ``--network-segment`` option on the ``subnet create`` command is
no longer a beta command option.
[Blueprint `routed-networks <https://blueprints.launchpad.net/neutron/+spec/routed-networks>`_]