def validate_template(template_body=None, template_url=None, region=None, key=None, keyid=None, profile=None):
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        # Returns an object if json is validated and an exception if its not
        return conn.validate_template(template_body, template_url)
    except BotoServerError as e:
        log.debug(e)
        msg = 'Error while trying to validate template {0}.'.format(template_body)
        log.error(msg)
        return str(e)
Validate cloudformation template
dataset/ETHPy150Open saltstack/salt/salt/modules/boto_cfn.py/validate_template