From 09f6bcadc56b437569ced3c55c187b02d7074a76 Mon Sep 17 00:00:00 2001 From: Peter Razumovsky Date: Thu, 11 Feb 2016 17:02:30 +0300 Subject: [PATCH] Merge properties in Neutron::Port before init Merge both properties schemas in OS::Neutron::Port before init in case of correctly documentation generating. Change-Id: I0092cf9d3c7a9ab1077cad6d33ac94325bf4c12c Closes-bug: #1544535 --- heat/engine/resources/openstack/neutron/port.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/heat/engine/resources/openstack/neutron/port.py b/heat/engine/resources/openstack/neutron/port.py index 411cdb4687..48253e5c05 100644 --- a/heat/engine/resources/openstack/neutron/port.py +++ b/heat/engine/resources/openstack/neutron/port.py @@ -261,6 +261,12 @@ class Port(neutron.NeutronResource): ), } + # Need to update properties_schema with other properties before + # initialisation, because resource should contain all properties before + # creating. Also, documentation should correctly resolves resource + # properties schema. + properties_schema.update(extra_properties_schema) + attributes_schema = { ADMIN_STATE_UP_ATTR: attributes.Schema( _("The administrative state of this port."), @@ -323,11 +329,6 @@ class Port(neutron.NeutronResource): ), } - def __init__(self, name, definition, stack): - """Overloaded init in case of merging two schemas to one.""" - self.properties_schema.update(self.extra_properties_schema) - super(Port, self).__init__(name, definition, stack) - def translation_rules(self, props): return [ translation.TranslationRule(