Merge "Support for epg subnet in gbp client." into stable/yoga
This commit is contained in:
		@@ -42,6 +42,9 @@ def _get_attrs_subnet_extension(client_manager, parsed_args, is_create=True):
 | 
			
		||||
        attrs['apic:snat_subnet_only'] = True
 | 
			
		||||
    if parsed_args.apic_snat_subnet_only_disable:
 | 
			
		||||
        attrs['apic:snat_subnet_only'] = False
 | 
			
		||||
    if ('apic_epg_subnet' in parsed_args and
 | 
			
		||||
        parsed_args.apic_epg_subnet):
 | 
			
		||||
        attrs['apic:epg_subnet'] = True
 | 
			
		||||
 | 
			
		||||
    return attrs
 | 
			
		||||
 | 
			
		||||
@@ -58,6 +61,8 @@ subnet_sdk.Subnet.apic_active_active_aap = resource.Body(
 | 
			
		||||
    'apic:active_active_aap')
 | 
			
		||||
subnet_sdk.Subnet.apic_snat_subnet_only = resource.Body(
 | 
			
		||||
    'apic:snat_subnet_only')
 | 
			
		||||
subnet_sdk.Subnet.apic_epg_subnet = resource.Body(
 | 
			
		||||
    'apic:epg_subnet')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class CreateSubnetExtension(hooks.CommandHook):
 | 
			
		||||
@@ -108,6 +113,14 @@ class CreateSubnetExtension(hooks.CommandHook):
 | 
			
		||||
            help=_("Set APIC snat subnet only to false\n"
 | 
			
		||||
                   "Default value for apic_snat_subnet_only is False ")
 | 
			
		||||
        )
 | 
			
		||||
        parser.add_argument(
 | 
			
		||||
            '--apic-epg-subnet',
 | 
			
		||||
            action='store_true',
 | 
			
		||||
            default=False,
 | 
			
		||||
            dest='apic_epg_subnet',
 | 
			
		||||
            help=_("Set APIC epg subnet to true\n"
 | 
			
		||||
                   "Default value for apic_epg_subnet is False ")
 | 
			
		||||
        )
 | 
			
		||||
        return parser
 | 
			
		||||
 | 
			
		||||
    def get_epilog(self):
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,7 @@ class TestSubnetCreate(test_subnet.TestSubnet, test_cli20.CLITestV20Base):
 | 
			
		||||
            ('apic_snat_host_pool_enable', None),
 | 
			
		||||
            ('apic_active_active_aap_enable', None),
 | 
			
		||||
            ('apic_snat_subnet_only_enable', None),
 | 
			
		||||
            ('apic_epg_subnet', False)
 | 
			
		||||
        ]
 | 
			
		||||
        create_ext = subnet_ext.CreateSubnetExtension(self.app)
 | 
			
		||||
        parsed_args = self.check_parser_ext(
 | 
			
		||||
@@ -73,6 +74,7 @@ class TestSubnetCreate(test_subnet.TestSubnet, test_cli20.CLITestV20Base):
 | 
			
		||||
            "--apic-snat-host-pool-enable",
 | 
			
		||||
            "--apic-active-active-aap-enable",
 | 
			
		||||
            "--apic-snat-subnet-only-enable",
 | 
			
		||||
            "--apic-epg-subnet"
 | 
			
		||||
        ]
 | 
			
		||||
        verifylist = [
 | 
			
		||||
            ('name', self._subnet.name),
 | 
			
		||||
@@ -80,6 +82,7 @@ class TestSubnetCreate(test_subnet.TestSubnet, test_cli20.CLITestV20Base):
 | 
			
		||||
            ('apic_snat_host_pool_enable', True),
 | 
			
		||||
            ('apic_active_active_aap_enable', True),
 | 
			
		||||
            ('apic_snat_subnet_only_enable', True),
 | 
			
		||||
            ('apic_epg_subnet', True)
 | 
			
		||||
        ]
 | 
			
		||||
        create_ext = subnet_ext.CreateSubnetExtension(self.app)
 | 
			
		||||
        parsed_args = self.check_parser_ext(
 | 
			
		||||
@@ -94,6 +97,7 @@ class TestSubnetCreate(test_subnet.TestSubnet, test_cli20.CLITestV20Base):
 | 
			
		||||
            'apic:active_active_aap': True,
 | 
			
		||||
            'apic:snat_host_pool': True,
 | 
			
		||||
            'apic:snat_subnet_only': True,
 | 
			
		||||
            'apic:epg_subnet': True
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user