fix(region): qga ping don't report error on host return error

Signed-off-by: wanyaoqi <wanyaoqi@yunion.cn>
This commit is contained in:
wanyaoqi
2023-07-20 16:33:33 +08:00
parent bda6019cb0
commit a665c57879
+6 -1
View File
@@ -79,8 +79,13 @@ func (self *SGuest) PerformQgaPing(
return nil, httperrors.NewBadRequestError("can't use qga in vm status: %s", self.Status)
}
res := jsonutils.NewDict()
host, _ := self.GetHost()
return nil, self.GetDriver().QgaRequestGuestPing(ctx, mcclient.GetTokenHeaders(userCred), host, self, false, input)
err := self.GetDriver().QgaRequestGuestPing(ctx, mcclient.GetTokenHeaders(userCred), host, self, false, input)
if err != nil {
res.Set("ping_error", jsonutils.NewString(err.Error()))
}
return res, nil
}
func (self *SGuest) PerformQgaCommand(