'Get a list of Artifacts from yaml.'

def ArtifactsFromYaml(self, yaml_content):

    try:
        raw_list = list(yaml.safe_load_all(yaml_content))
    except (ValueError, yaml.YAMLError) as e:
        raise ArtifactDefinitionError(('Invalid    YAML    for    artifact:    %s' % e))
    if (isinstance(raw_list, list) and (len(raw_list) == 1) and isinstance(raw_list[0], list)):
        raw_list = raw_list[0]
    valid_artifacts = []
    for artifact_dict in raw_list:
        try:
            artifact_value = Artifact(**artifact_dict)
            valid_artifacts.append(artifact_value)
        except (TypeError, AttributeError, type_info.TypeValueError) as e:
            raise ArtifactDefinitionError(('Invalid    artifact    definition    for    %s:    %s' % (artifact_dict.get('name'), e)))
    return valid_artifacts
