yaml.dumps() doesn't exist. Use dump().