mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix: unhandled errors (#25383)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -151,7 +151,11 @@ func (h *DHCPHandler) newRequest(pkt dhcp.Packet, man IBaremetalManager) (*dhcpR
|
||||
default:
|
||||
err = errors.Error("malformed client GUID (option 97), wrong size")
|
||||
}
|
||||
cliGuid, err = req.Options.String(optCode)
|
||||
cliGuidStr, guidErr := req.Options.String(optCode)
|
||||
if err == nil {
|
||||
err = guidErr
|
||||
}
|
||||
cliGuid = cliGuidStr
|
||||
}
|
||||
if err != nil {
|
||||
log.Errorf("[DHCP] parse vendor option %d error: %v", optCode, err)
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/mvcli"
|
||||
_ "yunion.io/x/onecloud/pkg/baremetal/utils/raid/sas2iru"
|
||||
"yunion.io/x/onecloud/pkg/compute/baremetal"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
)
|
||||
|
||||
func GetDriver(name string, term raid.IExecTerm) raid.IRaidDriver {
|
||||
@@ -122,8 +123,11 @@ func buildRaid(driver raid.IRaidDriver, adapter raid.IRaidAdapter, confs []*api.
|
||||
|
||||
for _, conf := range confs {
|
||||
selected, left, err = baremetal.RetrieveStorages(conf, left)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "baremetal.RetrieveStorages")
|
||||
}
|
||||
if len(selected) == 0 {
|
||||
return errors.Wrapf(err, "no enough disks for config %#v", conf)
|
||||
return errors.Wrapf(httperrors.ErrInputParameter, "no enough disks for config %#v", conf)
|
||||
}
|
||||
var err error
|
||||
switch conf.Conf {
|
||||
|
||||
Reference in New Issue
Block a user