Add HIDDEN status to network_id Neutron::Subnet
Add HIDDEN status and translation rules to Subnet resource. bp deprecating-improvements Change-Id: I26f58e5d68a6c78681c1d93c4651998755506101
This commit is contained in:
parent
9479c5bd94
commit
5033c190ba
@ -66,9 +66,14 @@ class Subnet(neutron.NeutronResource):
|
|||||||
NETWORK_ID: properties.Schema(
|
NETWORK_ID: properties.Schema(
|
||||||
properties.Schema.STRING,
|
properties.Schema.STRING,
|
||||||
support_status=support.SupportStatus(
|
support_status=support.SupportStatus(
|
||||||
status=support.DEPRECATED,
|
status=support.HIDDEN,
|
||||||
|
version='5.0.0',
|
||||||
message=_('Use property %s.') % NETWORK,
|
message=_('Use property %s.') % NETWORK,
|
||||||
version='2014.2'),
|
previous_status=support.SupportStatus(
|
||||||
|
status=support.DEPRECATED,
|
||||||
|
version='2014.2'
|
||||||
|
)
|
||||||
|
),
|
||||||
constraints=[
|
constraints=[
|
||||||
constraints.CustomConstraint('neutron.network')
|
constraints.CustomConstraint('neutron.network')
|
||||||
],
|
],
|
||||||
@ -240,6 +245,14 @@ class Subnet(neutron.NeutronResource):
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def translation_rules(self):
|
||||||
|
return [
|
||||||
|
properties.TranslationRule(self.properties,
|
||||||
|
properties.TranslationRule.REPLACE,
|
||||||
|
[self.NETWORK],
|
||||||
|
value_path=[self.NETWORK_ID])
|
||||||
|
]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _null_gateway_ip(cls, props):
|
def _null_gateway_ip(cls, props):
|
||||||
if cls.GATEWAY_IP not in props:
|
if cls.GATEWAY_IP not in props:
|
||||||
|
@ -485,3 +485,26 @@ class NeutronSubnetTest(common.HeatTestCase):
|
|||||||
rsrc.validate)
|
rsrc.validate)
|
||||||
self.assertEqual("ipv6_ra_mode and ipv6_address_mode are not "
|
self.assertEqual("ipv6_ra_mode and ipv6_address_mode are not "
|
||||||
"supported for ipv4.", six.text_type(ex))
|
"supported for ipv4.", six.text_type(ex))
|
||||||
|
|
||||||
|
def test_deprecated_network_id(self):
|
||||||
|
template = """
|
||||||
|
heat_template_version: 2015-04-30
|
||||||
|
resources:
|
||||||
|
net:
|
||||||
|
type: OS::Neutron::Net
|
||||||
|
properties:
|
||||||
|
name: test
|
||||||
|
subnet:
|
||||||
|
type: OS::Neutron::Subnet
|
||||||
|
properties:
|
||||||
|
network_id: { get_resource: net }
|
||||||
|
cidr: 10.0.0.0/24
|
||||||
|
"""
|
||||||
|
t = template_format.parse(template)
|
||||||
|
stack = utils.parse_stack(t)
|
||||||
|
rsrc = stack['subnet']
|
||||||
|
stack.create()
|
||||||
|
|
||||||
|
self.assertEqual(cfn_funcs.ResourceRef(stack, 'get_resource', 'net'),
|
||||||
|
rsrc.properties.get('network'))
|
||||||
|
self.assertIsNone(rsrc.properties.get('network_id'))
|
||||||
|
Loading…
Reference in New Issue
Block a user