From 4d2156255669af7c35204efc74e1efd2c9541613 Mon Sep 17 00:00:00 2001 From: wanyaoqi Date: Wed, 27 Feb 2019 13:50:35 +0800 Subject: [PATCH 1/2] fix delete disk panic --- pkg/compute/models/disks.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/disks.go b/pkg/compute/models/disks.go index 56802a973a..ad5cb3652f 100644 --- a/pkg/compute/models/disks.go +++ b/pkg/compute/models/disks.go @@ -1395,7 +1395,8 @@ func (self *SDisk) PerformPurge(ctx context.Context, userCred mcclient.TokenCred } func (self *SDisk) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error { - if self.GetCloudprovider().Provider == CLOUD_PROVIDER_HUAWEI && self.GetSnapshotCount() > 0 { + provider := self.GetCloudprovider() + if provider != nil && provider.Provider == CLOUD_PROVIDER_HUAWEI && self.GetSnapshotCount() > 0 { return httperrors.NewForbiddenError("not allow to delete. Virtual disk must not have snapshots") } From 54bdb435509f4100dc09b128166dcf6e94d175c1 Mon Sep 17 00:00:00 2001 From: wanyaoqi Date: Wed, 27 Feb 2019 13:56:46 +0800 Subject: [PATCH 2/2] disable host reset iptables --- pkg/hostman/hostinfo/hostinfo.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/hostman/hostinfo/hostinfo.go b/pkg/hostman/hostinfo/hostinfo.go index c1496344da..d1e7e12bde 100644 --- a/pkg/hostman/hostinfo/hostinfo.go +++ b/pkg/hostman/hostinfo/hostinfo.go @@ -228,10 +228,10 @@ func (h *SHostInfo) prepareEnv() error { return err } - err = h.resetIptables() - if err != nil { - return err - } + // err = h.resetIptables() + // if err != nil { + // return err + // } if options.HostOptions.EnableKsm { h.EnableKsm(900)