heat-translator/translator/toscalib/elements/property_definition.py
Sahdev Zala 78ded47386 Remove tosca node template inheritance from node type.
Tosca node templates and node type should be separate. This will also make
tosca properties and properties definition cleaner.

Change-Id: I67cb60af1849fb02d0c982f82c8e4858aa21f2fc
Implements: blueprint tosca-nodetemplate-inheritance
2014-06-06 14:41:36 -05:00

32 lines
1.0 KiB
Python

# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class PropertyDef(object):
'''TOSCA built-in Property type.'''
def __init__(self, name, value=None, schema=None):
self.name = name
self.value = value
self.schema = schema
@property
def required(self):
if self.schema:
for prop_key, prop_vale in self.schema.items():
if prop_key == 'required' and prop_vale:
return True
return False