1616# TODO(rtheis): Add description and name properties when support is available.
1717
1818from openstackclient .common import command
19- from openstackclient .common import exceptions
2019from openstackclient .common import utils
2120from openstackclient .i18n import _
2221
@@ -25,7 +24,7 @@ class ListNetworkSegment(command.Lister):
2524 """List network segments
2625
2726 (Caution: This is a beta command and subject to change.
28- Use global option --enable -beta-commands to enable
27+ Use global option --os -beta-command to enable
2928 this command)
3029 """
3130
@@ -46,11 +45,7 @@ def get_parser(self, prog_name):
4645 return parser
4746
4847 def take_action (self , parsed_args ):
49- if not self .app .options .enable_beta_commands :
50- msg = _ ('Caution: This is a beta command and subject to '
51- 'change. Use global option --enable-beta-commands '
52- 'to enable this command.' )
53- raise exceptions .CommandError (msg )
48+ self .validate_os_beta_command_enabled ()
5449
5550 network_client = self .app .client_manager .network
5651
@@ -94,7 +89,7 @@ class ShowNetworkSegment(command.ShowOne):
9489 """Display network segment details
9590
9691 (Caution: This is a beta command and subject to change.
97- Use global option --enable -beta-commands to enable
92+ Use global option --os -beta-command to enable
9893 this command)
9994 """
10095
@@ -108,11 +103,7 @@ def get_parser(self, prog_name):
108103 return parser
109104
110105 def take_action (self , parsed_args ):
111- if not self .app .options .enable_beta_commands :
112- msg = _ ('Caution: This is a beta command and subject to '
113- 'change. Use global option --enable-beta-commands '
114- 'to enable this command.' )
115- raise exceptions .CommandError (msg )
106+ self .validate_os_beta_command_enabled ()
116107
117108 client = self .app .client_manager .network
118109 obj = client .find_segment (
0 commit comments