Browse Source

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
tags/6.0.0.0b3
Peter Razumovsky 4 years ago
parent
commit
09f6bcadc5
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      heat/engine/resources/openstack/neutron/port.py

+ 6
- 5
heat/engine/resources/openstack/neutron/port.py View File

@@ -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(


Loading…
Cancel
Save