From f8a37d94191f9a6555493fbcc178cfd94eca4fe7 Mon Sep 17 00:00:00 2001 From: rainzm Date: Thu, 15 Apr 2021 18:32:18 +0800 Subject: [PATCH] fix(region): Remind that cloud account synchronization failed due to network synchronization failure --- pkg/compute/models/cloudaccounts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compute/models/cloudaccounts.go b/pkg/compute/models/cloudaccounts.go index 49ed892f30..66078b9ab4 100644 --- a/pkg/compute/models/cloudaccounts.go +++ b/pkg/compute/models/cloudaccounts.go @@ -2842,6 +2842,9 @@ func (cd *SCloudaccount) GetHost2Wire(ctx context.Context, userCred mcclient.Tok return cd.vmwareHostWireCache, nil } hwJson := cd.GetMetadataJson(METADATA_EXT_HOST2WIRE_KEY, userCred) + if hwJson == nil { + return nil, fmt.Errorf("The cloud account synchronization network may have failed, please check the operation log first and solve the synchronization network problem") + } ret := make(map[string][]SVs2Wire) err := hwJson.Unmarshal(&ret) if err != nil {