[#898] control: Remove removed flag from RemoveChainLocalOverrideResponse
* Remove removed flag in service.proto for RemoveChainLocalOverrideResponse. * Regenerate control API. * Return error only if RemoveOverride returns non-NotFound code. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
75a1a95c2c
commit
93bf9acbc2
5 changed files with 3 additions and 14 deletions
|
@ -57,11 +57,7 @@ func removeRule(cmd *cobra.Command, _ []string) {
|
|||
|
||||
verifyResponse(cmd, resp.GetSignature(), resp.GetBody())
|
||||
|
||||
if resp.GetBody().GetRemoved() {
|
||||
cmd.Println("Rule has been removed.")
|
||||
} else {
|
||||
cmd.Println("Rule has not been removed.")
|
||||
}
|
||||
}
|
||||
|
||||
func initControlRemoveRuleCmd() {
|
||||
|
|
|
@ -159,19 +159,13 @@ func (s *Server) RemoveChainLocalOverride(_ context.Context, req *control.Remove
|
|||
return nil, err
|
||||
}
|
||||
|
||||
removed := true
|
||||
if err = s.localOverrideStorage.LocalStorage().RemoveOverride(apechain.Ingress, target, apechain.ID(req.GetBody().GetChainId())); err != nil {
|
||||
code := getCodeByLocalStorageErr(err)
|
||||
if code == codes.NotFound {
|
||||
removed = false
|
||||
} else {
|
||||
if code := getCodeByLocalStorageErr(err); code != codes.NotFound {
|
||||
return nil, status.Error(code, err.Error())
|
||||
}
|
||||
}
|
||||
resp := &control.RemoveChainLocalOverrideResponse{
|
||||
Body: &control.RemoveChainLocalOverrideResponse_Body{
|
||||
Removed: removed,
|
||||
},
|
||||
Body: &control.RemoveChainLocalOverrideResponse_Body{},
|
||||
}
|
||||
err = SignMessage(s.key, resp)
|
||||
if err != nil {
|
||||
|
|
BIN
pkg/services/control/service.pb.go
generated
BIN
pkg/services/control/service.pb.go
generated
Binary file not shown.
|
@ -566,7 +566,6 @@ message RemoveChainLocalOverrideRequest {
|
|||
|
||||
message RemoveChainLocalOverrideResponse {
|
||||
message Body {
|
||||
bool removed = 1;
|
||||
}
|
||||
|
||||
Body body = 1;
|
||||
|
|
BIN
pkg/services/control/service_frostfs.pb.go
generated
BIN
pkg/services/control/service_frostfs.pb.go
generated
Binary file not shown.
Loading…
Reference in a new issue