Skip to content

Commit

Permalink
remove dead code (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichSchreiner authored Mar 4, 2024
1 parent 9858b21 commit 405ad42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions cmd/metal-api/internal/service/image-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,8 @@ func (r *imageResource) deleteImage(request *restful.Request, response *restful.

machines := r.machinesByImage(ms, img.ID)
if len(machines) > 0 {
if err != nil {
r.sendError(request, response, httperrors.UnprocessableEntity(fmt.Errorf("image %s is in use by machines:%v", img.ID, machines)))
return
}
r.sendError(request, response, httperrors.UnprocessableEntity(fmt.Errorf("image %s is in use by machines:%v", img.ID, machines)))
return
}

err = r.ds.DeleteImage(img)
Expand Down
6 changes: 2 additions & 4 deletions cmd/metal-api/internal/service/network-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,8 @@ func (r *networkResource) deleteNetwork(request *restful.Request, response *rest
}

if len(children) != 0 {
if err != nil {
r.sendError(request, response, defaultError(errors.New("network cannot be deleted because there are children of this network")))
return
}
r.sendError(request, response, defaultError(errors.New("network cannot be deleted because there are children of this network")))
return
}

allIPs, err := r.ds.ListIPs()
Expand Down

0 comments on commit 405ad42

Please sign in to comment.