mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #666 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-conflict-resolve-2.4.0-20181204 to release/2.4.0
* commit 'f5c98090b2358577b97a556b894838e2f8280a95': fix: region delete guest panic when host is nil
This commit is contained in:
@@ -26,7 +26,7 @@ func init() {
|
||||
func (self *GuestDeleteTask) OnInit(ctx context.Context, obj db.IStandaloneModel, data jsonutils.JSONObject) {
|
||||
guest := obj.(*models.SGuest)
|
||||
host := guest.GetHost()
|
||||
if guest.Hypervisor == models.HYPERVISOR_BAREMETAL && host.HostType != models.HOST_TYPE_BAREMETAL {
|
||||
if guest.Hypervisor == models.HYPERVISOR_BAREMETAL && host != nil && host.HostType != models.HOST_TYPE_BAREMETAL {
|
||||
// if a fake server for converted hypervisor, then just skip stop
|
||||
self.OnGuestStopComplete(ctx, obj, data)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user