def record_absent(name, zone, type, data, profile):
 zones = libcloud_dns_module.list_zones(profile)
 try:
  matching_zone = [z for z in zones if (z.domain == zone)][0]
 except IndexError:
  return state_result(False, 'Zone could not be found')
 records = libcloud_dns_module.list_records(matching_zone.id, profile)
 matching_records = [record for record in records if ((record.name == name) and (record.type == type) and (record.data == data))]
 if (len(matching_records) > 0):
  result = []
  for record in matching_records:
   result.append(libcloud_dns_module.delete_record(matching_zone.id, record.id, profile))
  return state_result(all(result), 'Removed {0} records'.format(len(result)))
 else:
  return state_result(True, 'Records already absent')

def record_absent ( name , zone , type , data , profile ) : zones = libcloud_dns_module . list_zones ( profile ) try : matching_zone = [ z for z in zones if ( z . domain == zone ) ] [ 0 ] except IndexError : return state_result ( False , 'Zone could not be found' ) records = libcloud_dns_module . list_records ( matching_zone . id , profile ) matching_records = [ record for record in records if ( ( record . name == name ) and ( record . type == type ) and ( record . data == data ) ) ] if ( len ( matching_records ) > 0 ) : result = [ ] for record in matching_records : result . append ( libcloud_dns_module . delete_record ( matching_zone . id , record . id , profile ) ) return state_result ( all ( result ) , 'Removed {0} records' . format ( len ( result ) ) ) else : return state_result ( True , 'Records already absent' )
ensures a record is absent .