'Create a new ResourceInfo of the appropriate class.'

def __new__(cls, registry, path, value):

    if (cls is not ResourceInfo):
        return super(ResourceInfo, cls).__new__(cls)
    name = path[(-1)]
    if name.endswith(('.yaml', '.template')):
        klass = TemplateResourceInfo
    elif (not isinstance(value, six.string_types)):
        klass = ClassResourceInfo
    elif value.endswith(('.yaml', '.template')):
        klass = TemplateResourceInfo
    elif name.endswith('*'):
        klass = GlobResourceInfo
    else:
        klass = MapResourceInfo
    return super(ResourceInfo, cls).__new__(klass)
