Check for tosca keyword in the TOSCA type

Check for tosca keyword in the given tosca type to handle short type name.

Change-Id: I398a5192809ba88d2c11bcb0657a03dd0e1f97f9
Closes-Bug: #1382646
This commit is contained in:
spzala
2014-10-19 15:29:08 -07:00
parent 54da66e44f
commit 93f7ed74b1
2 changed files with 2 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ class EntityType(object):
RELATIONSHIP_PREFIX = 'tosca.relationships.'
CAPABILITY_PREFIX = 'tosca.capabilities.'
INTERFACE_PREFIX = 'tosca.interfaces.'
TOSCA = 'tosca'
def derived_from(self, defs):
'''Return a type this type is derived from.'''

View File

@@ -29,7 +29,7 @@ class StatefulEntityType(EntityType):
'remove_target']
def __init__(self, entitytype, prefix, custom_def=None):
if prefix not in entitytype:
if not entitytype.startswith(self.TOSCA):
entitytype = prefix + entitytype
if entitytype in list(self.TOSCA_DEF.keys()):
self.defs = self.TOSCA_DEF[entitytype]