Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dead code #508

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading