Merge "Add --description to Create/Set Network"
This commit is contained in:
		@@ -23,6 +23,7 @@ Create new network
 | 
			
		||||
        [--project <project> [--project-domain <project-domain>]]
 | 
			
		||||
        [--enable | --disable]
 | 
			
		||||
        [--share | --no-share]
 | 
			
		||||
        [--description <description>]
 | 
			
		||||
        [--availability-zone-hint <availability-zone>]
 | 
			
		||||
        [--enable-port-security | --disable-port-security]
 | 
			
		||||
        [--external [--default | --no-default] | --internal]
 | 
			
		||||
@@ -65,6 +66,10 @@ Create new network
 | 
			
		||||
 | 
			
		||||
    Do not share the network between projects
 | 
			
		||||
 | 
			
		||||
.. option:: --description <description>
 | 
			
		||||
 | 
			
		||||
    Set network description
 | 
			
		||||
 | 
			
		||||
.. option:: --availability-zone-hint <availability-zone>
 | 
			
		||||
 | 
			
		||||
    Availability Zone in which to create this network
 | 
			
		||||
@@ -206,6 +211,7 @@ Set network properties
 | 
			
		||||
        [--name <name>]
 | 
			
		||||
        [--enable | --disable]
 | 
			
		||||
        [--share | --no-share]
 | 
			
		||||
        [--description <description>]
 | 
			
		||||
        [--enable-port-security | --disable-port-security]
 | 
			
		||||
        [--external [--default | --no-default] | --internal]
 | 
			
		||||
        [--provider-network-type <provider-network-type>]
 | 
			
		||||
@@ -234,6 +240,10 @@ Set network properties
 | 
			
		||||
 | 
			
		||||
    Do not share the network between projects
 | 
			
		||||
 | 
			
		||||
.. option:: --description <description>
 | 
			
		||||
 | 
			
		||||
    Set network description
 | 
			
		||||
 | 
			
		||||
.. option:: --enable-port-security
 | 
			
		||||
 | 
			
		||||
    Enable port security by default for ports created on
 | 
			
		||||
 
 | 
			
		||||
@@ -78,6 +78,10 @@ def _get_attrs(client_manager, parsed_args):
 | 
			
		||||
       parsed_args.availability_zone_hints is not None:
 | 
			
		||||
        attrs['availability_zone_hints'] = parsed_args.availability_zone_hints
 | 
			
		||||
 | 
			
		||||
    # set description
 | 
			
		||||
    if parsed_args.description:
 | 
			
		||||
        attrs['description'] = parsed_args.description
 | 
			
		||||
 | 
			
		||||
    # update_external_network_options
 | 
			
		||||
    if parsed_args.internal:
 | 
			
		||||
        attrs['router:external'] = False
 | 
			
		||||
@@ -191,6 +195,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
 | 
			
		||||
            metavar='<project>',
 | 
			
		||||
            help=_("Owner's project (name or ID)")
 | 
			
		||||
        )
 | 
			
		||||
        parser.add_argument(
 | 
			
		||||
            '--description',
 | 
			
		||||
            metavar='<description>',
 | 
			
		||||
            help=_("Set network description")
 | 
			
		||||
        )
 | 
			
		||||
        identity_common.add_project_domain_option_to_parser(parser)
 | 
			
		||||
        parser.add_argument(
 | 
			
		||||
            '--availability-zone-hint',
 | 
			
		||||
@@ -420,6 +429,11 @@ class SetNetwork(command.Command):
 | 
			
		||||
            action='store_true',
 | 
			
		||||
            help=_("Do not share the network between projects")
 | 
			
		||||
        )
 | 
			
		||||
        parser.add_argument(
 | 
			
		||||
            '--description',
 | 
			
		||||
            metavar="<description",
 | 
			
		||||
            help=_("Set network description")
 | 
			
		||||
        )
 | 
			
		||||
        port_security_group = parser.add_mutually_exclusive_group()
 | 
			
		||||
        port_security_group.add_argument(
 | 
			
		||||
            '--enable-port-security',
 | 
			
		||||
 
 | 
			
		||||
@@ -285,6 +285,7 @@ class FakeNetwork(object):
 | 
			
		||||
            'id': 'network-id-' + uuid.uuid4().hex,
 | 
			
		||||
            'name': 'network-name-' + uuid.uuid4().hex,
 | 
			
		||||
            'status': 'ACTIVE',
 | 
			
		||||
            'description': 'network-description-' + uuid.uuid4().hex,
 | 
			
		||||
            'tenant_id': 'project-id-' + uuid.uuid4().hex,
 | 
			
		||||
            'admin_state_up': True,
 | 
			
		||||
            'shared': False,
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
 | 
			
		||||
        'admin_state_up',
 | 
			
		||||
        'availability_zone_hints',
 | 
			
		||||
        'availability_zones',
 | 
			
		||||
        'description',
 | 
			
		||||
        'id',
 | 
			
		||||
        'is_default',
 | 
			
		||||
        'name',
 | 
			
		||||
@@ -73,6 +74,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
 | 
			
		||||
        network._format_admin_state(_network.admin_state_up),
 | 
			
		||||
        utils.format_list(_network.availability_zone_hints),
 | 
			
		||||
        utils.format_list(_network.availability_zones),
 | 
			
		||||
        _network.description,
 | 
			
		||||
        _network.id,
 | 
			
		||||
        _network.is_default,
 | 
			
		||||
        _network.name,
 | 
			
		||||
@@ -129,6 +131,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
 | 
			
		||||
        arglist = [
 | 
			
		||||
            "--disable",
 | 
			
		||||
            "--share",
 | 
			
		||||
            "--description", self._network.description,
 | 
			
		||||
            "--project", self.project.name,
 | 
			
		||||
            "--project-domain", self.domain.name,
 | 
			
		||||
            "--availability-zone-hint", "nova",
 | 
			
		||||
@@ -143,6 +146,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
 | 
			
		||||
        verifylist = [
 | 
			
		||||
            ('disable', True),
 | 
			
		||||
            ('share', True),
 | 
			
		||||
            ('description', self._network.description),
 | 
			
		||||
            ('project', self.project.name),
 | 
			
		||||
            ('project_domain', self.domain.name),
 | 
			
		||||
            ('availability_zone_hints', ["nova"]),
 | 
			
		||||
@@ -164,6 +168,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
 | 
			
		||||
            'availability_zone_hints': ["nova"],
 | 
			
		||||
            'name': self._network.name,
 | 
			
		||||
            'shared': True,
 | 
			
		||||
            'description': self._network.description,
 | 
			
		||||
            'tenant_id': self.project.id,
 | 
			
		||||
            'is_default': True,
 | 
			
		||||
            'router:external': True,
 | 
			
		||||
@@ -216,6 +221,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
 | 
			
		||||
        'admin_state_up',
 | 
			
		||||
        'availability_zone_hints',
 | 
			
		||||
        'availability_zones',
 | 
			
		||||
        'description',
 | 
			
		||||
        'id',
 | 
			
		||||
        'is_default',
 | 
			
		||||
        'name',
 | 
			
		||||
@@ -232,6 +238,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
 | 
			
		||||
        network._format_admin_state(_network.admin_state_up),
 | 
			
		||||
        utils.format_list(_network.availability_zone_hints),
 | 
			
		||||
        utils.format_list(_network.availability_zones),
 | 
			
		||||
        _network.description,
 | 
			
		||||
        _network.id,
 | 
			
		||||
        _network.is_default,
 | 
			
		||||
        _network.name,
 | 
			
		||||
@@ -532,6 +539,7 @@ class TestSetNetwork(TestNetwork):
 | 
			
		||||
            '--enable',
 | 
			
		||||
            '--name', 'noob',
 | 
			
		||||
            '--share',
 | 
			
		||||
            '--description', self._network.description,
 | 
			
		||||
            '--external',
 | 
			
		||||
            '--default',
 | 
			
		||||
            '--provider-network-type', 'vlan',
 | 
			
		||||
@@ -543,6 +551,7 @@ class TestSetNetwork(TestNetwork):
 | 
			
		||||
        verifylist = [
 | 
			
		||||
            ('network', self._network.name),
 | 
			
		||||
            ('enable', True),
 | 
			
		||||
            ('description', self._network.description),
 | 
			
		||||
            ('name', 'noob'),
 | 
			
		||||
            ('share', True),
 | 
			
		||||
            ('external', True),
 | 
			
		||||
@@ -560,6 +569,7 @@ class TestSetNetwork(TestNetwork):
 | 
			
		||||
        attrs = {
 | 
			
		||||
            'name': 'noob',
 | 
			
		||||
            'admin_state_up': True,
 | 
			
		||||
            'description': self._network.description,
 | 
			
		||||
            'shared': True,
 | 
			
		||||
            'router:external': True,
 | 
			
		||||
            'is_default': True,
 | 
			
		||||
@@ -624,6 +634,7 @@ class TestShowNetwork(TestNetwork):
 | 
			
		||||
        'admin_state_up',
 | 
			
		||||
        'availability_zone_hints',
 | 
			
		||||
        'availability_zones',
 | 
			
		||||
        'description',
 | 
			
		||||
        'id',
 | 
			
		||||
        'is_default',
 | 
			
		||||
        'name',
 | 
			
		||||
@@ -640,6 +651,7 @@ class TestShowNetwork(TestNetwork):
 | 
			
		||||
        network._format_admin_state(_network.admin_state_up),
 | 
			
		||||
        utils.format_list(_network.availability_zone_hints),
 | 
			
		||||
        utils.format_list(_network.availability_zones),
 | 
			
		||||
        _network.description,
 | 
			
		||||
        _network.id,
 | 
			
		||||
        _network.is_default,
 | 
			
		||||
        _network.name,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user