Add HIDDEN status to Neutron::VPNService

Add HIDDEN status and translation rules to
VPNService resource.

bp deprecating-improvements

Change-Id: I3324152807423d47424c9b0571080bb0ab293766
This commit is contained in:
Peter Razumovsky
2015-06-29 09:38:11 +03:00
parent 6d0f8960fa
commit 67e45d633a
2 changed files with 22 additions and 7 deletions

View File

@@ -60,9 +60,14 @@ class VPNService(neutron.NeutronResource):
SUBNET_ID: properties.Schema(
properties.Schema.STRING,
support_status=support.SupportStatus(
status=support.DEPRECATED,
status=support.HIDDEN,
message=_('Use property %s.') % SUBNET,
version='2014.2'),
version='5.0.0',
previous_status=support.SupportStatus(
status=support.DEPRECATED,
version='2014.2'
)
),
constraints=[
constraints.CustomConstraint('neutron.subnet')
]
@@ -131,6 +136,16 @@ class VPNService(neutron.NeutronResource):
),
}
def translation_rules(self):
return [
properties.TranslationRule(
self.properties,
properties.TranslationRule.REPLACE,
[self.SUBNET],
value_path=[self.SUBNET_ID]
)
]
def _show_resource(self):
return self.neutron().show_vpnservice(self.resource_id)['vpnservice']

View File

@@ -131,12 +131,12 @@ class VPNServiceTest(common.HeatTestCase):
def create_vpnservice(self, resolve_neutron=True, resolve_router=True):
self.stub_SubnetConstraint_validate()
self.stub_RouterConstraint_validate()
neutronV20.find_resourceid_by_name_or_id(
mox.IsA(neutronclient.Client),
'subnet',
'sub123'
).AndReturn('sub123')
if resolve_neutron:
neutronV20.find_resourceid_by_name_or_id(
mox.IsA(neutronclient.Client),
'subnet',
'sub123'
).AndReturn('sub123')
snippet = template_format.parse(vpnservice_template)
else:
snippet = template_format.parse(vpnservice_template_deprecated)