Skip to content

Commit

Permalink
Fix merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
ganglyu committed Nov 6, 2024
1 parent ef1910a commit 50bd99b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gnmi_server/gnoi.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,26 @@ func HaltSystem() error {
return err
}

// TODO: Support GNOI Reboot
func (srv *SystemServer) Reboot(ctx context.Context, req *gnoi_system_pb.RebootRequest) (*gnoi_system_pb.RebootResponse, error) {
_, err := authenticate(srv.config, ctx)
if err != nil {
return nil, err
}
log.V(1).Info("gNOI: Reboot")
return nil, status.Errorf(codes.Unimplemented, "")
log.V(1).Info("Request:", req)

// Check the reboot type
switch req.GetMethod() {
case gnoi_system_pb.RebootMethod_HALT:
log.V(1).Info("Reboot method is HALT. Halting the system...")
err = HaltSystem()
if err != nil {
return nil, err
}
}

var resp gnoi_system_pb.RebootResponse
return &resp, nil
}

// TODO: Support GNOI RebootStatus
Expand Down

0 comments on commit 50bd99b

Please sign in to comment.