From b7c1f521663b702fe442078c13f183c858649edb Mon Sep 17 00:00:00 2001 From: ioito Date: Thu, 18 Jul 2019 19:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E6=9B=B4=E6=94=B9openstack?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=AE=B9=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/storages.go | 4 +++- pkg/util/openstack/storage.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/storages.go b/pkg/compute/models/storages.go index 4ceff046d1..9e202e1726 100644 --- a/pkg/compute/models/storages.go +++ b/pkg/compute/models/storages.go @@ -635,7 +635,9 @@ func (self *SStorage) syncWithCloudStorage(ctx context.Context, userCred mcclien self.Status = extStorage.GetStatus() self.StorageType = extStorage.GetStorageType() self.MediumType = extStorage.GetMediumType() - self.Capacity = extStorage.GetCapacityMB() + if capacity := extStorage.GetCapacityMB(); capacity != 0 { + self.Capacity = capacity + } self.StorageConf = extStorage.GetStorageConf() self.Enabled = tristate.NewFromBool(extStorage.GetEnabled()) diff --git a/pkg/util/openstack/storage.go b/pkg/util/openstack/storage.go index 802a4fd0de..6277fa86f6 100644 --- a/pkg/util/openstack/storage.go +++ b/pkg/util/openstack/storage.go @@ -53,7 +53,7 @@ func (storage *SStorage) GetGlobalId() string { } func (storage *SStorage) IsEmulated() bool { - return true + return false } func (storage *SStorage) GetIZone() cloudprovider.ICloudZone {