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 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 .. program:: network segment create
.. code:: bash .. code:: bash
@ -63,10 +59,6 @@ network segment delete
Delete network segment(s) 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 .. program:: network segment delete
.. code:: bash .. code:: bash
@ -83,10 +75,6 @@ network segment list
List network segments 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 .. program:: network segment list
.. code:: bash .. code:: bash
@ -107,10 +95,6 @@ network segment set
Set network segment properties 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 .. program:: network segment set
.. code:: bash .. code:: bash
@ -137,10 +121,6 @@ network segment show
Display network segment details 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 .. program:: network segment show
.. code:: bash .. code:: bash

View File

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

View File

@ -26,12 +26,7 @@ LOG = logging.getLogger(__name__)
class CreateNetworkSegment(command.ShowOne): class CreateNetworkSegment(command.ShowOne):
"""Create new network segment """Create new network segment"""
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(CreateNetworkSegment, self).get_parser(prog_name) parser = super(CreateNetworkSegment, self).get_parser(prog_name)
@ -76,7 +71,6 @@ class CreateNetworkSegment(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network client = self.app.client_manager.network
attrs = {} attrs = {}
attrs['name'] = parsed_args.name attrs['name'] = parsed_args.name
@ -96,12 +90,7 @@ class CreateNetworkSegment(command.ShowOne):
class DeleteNetworkSegment(command.Command): class DeleteNetworkSegment(command.Command):
"""Delete network segment(s) """Delete network segment(s)"""
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(DeleteNetworkSegment, self).get_parser(prog_name) parser = super(DeleteNetworkSegment, self).get_parser(prog_name)
@ -114,7 +103,6 @@ class DeleteNetworkSegment(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network client = self.app.client_manager.network
result = 0 result = 0
@ -137,12 +125,7 @@ class DeleteNetworkSegment(command.Command):
class ListNetworkSegment(command.Lister): class ListNetworkSegment(command.Lister):
"""List network segments """List network segments"""
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ListNetworkSegment, self).get_parser(prog_name) parser = super(ListNetworkSegment, self).get_parser(prog_name)
@ -161,8 +144,6 @@ class ListNetworkSegment(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
network_client = self.app.client_manager.network network_client = self.app.client_manager.network
filters = {} filters = {}
@ -204,12 +185,7 @@ class ListNetworkSegment(command.Lister):
class SetNetworkSegment(command.Command): class SetNetworkSegment(command.Command):
"""Set network segment properties """Set network segment properties"""
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(SetNetworkSegment, self).get_parser(prog_name) parser = super(SetNetworkSegment, self).get_parser(prog_name)
@ -231,7 +207,6 @@ class SetNetworkSegment(command.Command):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network client = self.app.client_manager.network
obj = client.find_segment(parsed_args.network_segment, obj = client.find_segment(parsed_args.network_segment,
ignore_missing=False) ignore_missing=False)
@ -244,12 +219,7 @@ class SetNetworkSegment(command.Command):
class ShowNetworkSegment(command.ShowOne): class ShowNetworkSegment(command.ShowOne):
"""Display network segment details """Display network segment details"""
(Caution: This is a beta command and subject to change.
Use global option --os-beta-command to enable
this command)
"""
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ShowNetworkSegment, self).get_parser(prog_name) parser = super(ShowNetworkSegment, self).get_parser(prog_name)
@ -261,8 +231,6 @@ class ShowNetworkSegment(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
self.validate_os_beta_command_enabled()
client = self.app.client_manager.network client = self.app.client_manager.network
obj = client.find_segment( obj = client.find_segment(
parsed_args.network_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 attrs['ipv6_ra_mode'] = parsed_args.ipv6_ra_mode
if parsed_args.ipv6_address_mode is not None: if parsed_args.ipv6_address_mode is not None:
attrs['ipv6_address_mode'] = parsed_args.ipv6_address_mode 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( attrs['segment_id'] = client.find_segment(
parsed_args.network_segment, ignore_missing=False).id parsed_args.network_segment, ignore_missing=False).id
@ -299,12 +299,11 @@ class CreateSubnet(command.ShowOne):
help=_("IPv6 address mode, " help=_("IPv6 address mode, "
"valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]") "valid modes: [dhcpv6-stateful, dhcpv6-stateless, slaac]")
) )
if self.app.options.os_beta_command:
parser.add_argument( parser.add_argument(
'--network-segment', '--network-segment',
metavar='<network-segment>', metavar='<network-segment>',
help=_("Network segment to associate with this subnet " help=_("Network segment to associate with this subnet "
"(ID only)") "(name or ID)")
) )
parser.add_argument( parser.add_argument(
'--network', '--network',

View File

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

View File

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

View File

@ -379,23 +379,6 @@ class TestCreateSubnet(TestSubnet):
self.assertEqual(self.columns, columns) self.assertEqual(self.columns, columns)
self.assertEqual(self.data_ipv6, data) 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): def test_create_with_network_segment(self):
# Mock SDK calls for this test. # Mock SDK calls for this test.
self.network.create_subnet = mock.Mock(return_value=self._subnet) 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) parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args) columns, data = self.cmd.take_action(parsed_args)

View File

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