def delete_build_requests_with_no_instance_uuid(context, count):
 orphaned_build_requests = _get_build_requests_with_no_instance_uuid(context, count)
 done = 0
 for orphan_buildreq in orphaned_build_requests:
  result = _destroy_in_db(context, orphan_buildreq.id)
  if result:
   done += 1
 return (len(orphaned_build_requests), done)

def delete_build_requests_with_no_instance_uuid ( context , count ) : orphaned_build_requests = _get_build_requests_with_no_instance_uuid ( context , count ) done = 0 for orphan_buildreq in orphaned_build_requests : result = _destroy_in_db ( context , orphan_buildreq . id ) if result : done += 1 return ( len ( orphaned_build_requests ) , done )
online data migration which cleans up failed build requests from mitaka build_requests were initially a mirror of instances and had similar fields to satisfy listing/showing instances while they were building .